Lau
Posts: 0
Joined: Tue Jan 14, 2014 5:42 am

set the label text when a response is returned as "undefined"

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?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

set the label text when a response is returned as "undefined"

Hello!

Do you mean when Service failes?

Lau
Posts: 0
Joined: Tue Jan 14, 2014 5:42 am

set the label text when a response is returned as "undefined"

No, I mean the service returns as Completed with a response of "undefined"

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

set the label text when a response is returned as "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...

Lau
Posts: 0
Joined: Tue Jan 14, 2014 5:42 am

set the label text when a response is returned as "undefined"

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

set the label text when a response is returned as "undefined"

if (myValue == 'undefined') {
do something
}

this is just an example.. 'myValue' is the response that you get.

Lau
Posts: 0
Joined: Tue Jan 14, 2014 5:42 am

set the label text when a response is returned as "undefined"

how can I reference the response?
the response is nil I think, so it sets the label to undefined

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

set the label text when a response is returned as "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.

Michael2210441
Posts: 0
Joined: Sat Jan 04, 2014 5:42 pm

set the label text when a response is returned as "undefined"

Is there a simpler solution to preventing the label from displaying "undefined" when the response item mapped to the label returns null?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

set the label text when a response is returned as "undefined"

You can check this statement with JavaScript and set appropriate value according to your need.

Return to “Issues”