Page 1 of 2
set the label text when a response is returned as "undefined"
Posted: Sun Jan 19, 2014 2:13 am
by Lau
How can I set the label text when a response is returned as "undefined" ?
What should I configure on the component Completed event to recognize if the result is "undefined" so I can change the label accordingly?
set the label text when a response is returned as "undefined"
Posted: Sun Jan 19, 2014 2:50 am
by Alena Prykhodko
Hello!
Do you mean when Service failes?
set the label text when a response is returned as "undefined"
Posted: Sun Jan 19, 2014 3:23 am
by Lau
No, I mean the service returns as Completed with a response of "undefined"
set the label text when a response is returned as "undefined"
Posted: Sun Jan 19, 2014 5:53 am
by maxkatz
You can use the service callback events to set the value of a label component on a page: http://docs.appery.io/documentation/r...
set the label text when a response is returned as "undefined"
Posted: Sun Jan 19, 2014 7:44 pm
by Lau
Hi Max,
Yes I understand the error events and that is what I am trying to use.
The service returns "success" and the label is set to "undefined" since there is no return text.
How can I check that IF the return is success with value undefined to set label to something else?
set the label text when a response is returned as "undefined"
Posted: Mon Jan 20, 2014 1:48 am
by maxkatz
if (myValue == 'undefined') {
do something
}
this is just an example.. 'myValue' is the response that you get.
set the label text when a response is returned as "undefined"
Posted: Mon Jan 20, 2014 1:53 am
by Lau
how can I reference the response?
the response is nil I think, so it sets the label to undefined
set the label text when a response is returned as "undefined"
Posted: Mon Jan 20, 2014 4:39 am
by maxkatz
The 'data' parameter in the 'success' callback has the response. The callbacks are standard jQuery events. You can always refer to jQuery docs to learn more.
set the label text when a response is returned as "undefined"
Posted: Sat Jul 12, 2014 6:29 pm
by Michael2210441
Is there a simpler solution to preventing the label from displaying "undefined" when the response item mapped to the label returns null?
set the label text when a response is returned as "undefined"
Posted: Sat Jul 12, 2014 6:40 pm
by Alena Prykhodko
You can check this statement with JavaScript and set appropriate value according to your need.