Page 1 of 1

RSS service not return any news. Message informative.

Posted: Sun Jan 19, 2014 12:33 pm
by iuris

In my app I created a RSS service.
If the service does not return any news, want to put a message on a label saying "there is currently no news." How can I get it?


RSS service not return any news. Message informative.

Posted: Sun Jan 19, 2014 4:46 pm
by maxkatz

Use the service's callback: http://docs.appery.io/documentation/r....

Check if any data was returned.
Then set a label on the page to say that "there is currently no new".
You can us the Appery(..) function to set the component text: http://docs.appery.io/javascript-api/


RSS service not return any news. Message informative.

Posted: Sun Jan 19, 2014 5:13 pm
by iuris

How to "Check if any data was returned."?


RSS service not return any news. Message informative.

Posted: Sun Jan 19, 2014 5:30 pm
by maxkatz

The success event returns all the data from the service. You would use JavaScript to check for any conditions.


RSS service not return any news. Message informative.

Posted: Sun Jan 19, 2014 9:50 pm
by iuris

HI
Event Page Show Run Javascript

rs_Noticias_list.execute({});

This is called. What I have to put code. Could give an example, please?


RSS service not return any news. Message informative.

Posted: Mon Jan 20, 2014 1:46 am
by maxkatz

You can invoke the service via Invoke Service action (you don't need to do it from JavaScript). Then define success event in Data view. It has the 'data' parameter passed to it which includes the entire response. You would check the value that you need there. These are just standard jQuery callbacks. If you are not sure how they work, you can always refer to jQuery docs.