cancel
Showing results for 
Search instead for 
Did you mean: 

How to use message box in UI 5

Former Member
0 Kudos

Hi All,

When i am using message box in ui 5 , i am  facing issue if i call a function from call back function  and  display return value of that function it displays null

Please help me to fix this issue

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182048
Active Contributor
0 Kudos

Hi Arvind

Without seeing the code its hard to diagnose.

If you are using MessageBox in an MVC application it may be a scope "this" issue.

One quick fix would be to ensure the correct context is used

   sap.ui.commons.MessageBox.alert("Hello World!", $.proxy(fnCallback,this));

see http://api.jquery.com/jQuery.proxy/

Another would be

this.msg = 'Hello World";

var that = this;

..

function fnCallback(){

     alert(that.msg);

}

Again without seeing code, i am guessing

JSP

GrahamRobbo
Active Contributor
0 Kudos

It's pretty hard to answer your question without more information. Can you share a small code example that demonstrates the problem?