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?
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?
Hello!
Do you mean when Service failes?
No, I mean the service returns as Completed with a response of "undefined"
You can use the service callback events to set the value of a label component on a page: http://docs.appery.io/documentation/r...
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?
if (myValue == 'undefined') {
do something
}
this is just an example.. 'myValue' is the response that you get.
how can I reference the response?
the response is nil I think, so it sets the label to undefined
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.
Is there a simpler solution to preventing the label from displaying "undefined" when the response item mapped to the label returns null?
You can check this statement with JavaScript and set appropriate value according to your need.