leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Load Sequence and on Condition

Quite stumped on how to do these:

  1. For load sequence, I have this problem: I have 2 Rest services created for Intro and Detail pages. The intro page is not mapped to any gui components because it uses html through the panel component, but global variables are set up to capture data from the Rest service. Though the service is invoked, the service is not rendering any data. Seems like when it is not mapped data is not returned?

  2. On conditional load, I want the Intro page to load initially, from where the date for going through the detail could be selected.This should then SAVE the date to a file/db. From then on the Intro page doesn't load but the Detail page that correspond to the date.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Load Sequence and on Condition

Hello! Working on it.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Load Sequence and on Condition

oh, thank you!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Load Sequence and on Condition

Hi Leonardo,

  1. REST service has a Success event that receives full data from server in the first parameter. You can access this data through the parameter. I would advice you to use localStorage instead of global variables.

  2. In app settings set Start page = "Intro" to get initial data there.

    Create a service to save data in Database: http://docs.appery.io/tutorials/build...

    On Details page Load invoke service to read data from Database.

    You can also pass data through the localStorage to keep data while navigating between pages (the localStorage will be emptied when you leave the app).

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Load Sequence and on Condition

Thanks, will try it out.

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Load Sequence and on Condition

  1. I'm not sure I understand the "first parameter" you referred to. In the Data tab of the Intro page I set a data storage variable: introvar.
    On introservice Success I invoke the service
    On introservice Success I set LocalVariable introvar to value of the Response service data name. Still, I get nothing.
Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Load Sequence and on Condition

Hi Leonardo,

If you use multiple pages and do not tick "Render all pages in one html" and tick "Use full screen refresh" then your global variable is forever lost when navigating between pages.

To prevent this you can use localStorage to store data. You should remember that localstorage stores a simple string only. To save complex structures there you can use codeJSON.stringify (varible);/code

leonardo
Posts: 0
Joined: Thu Mar 14, 2013 7:04 pm

Load Sequence and on Condition

Thanks Katya for your help here. Under App Setting/General, I ticked "Render all pages in one html." I couldn't find "Use full screen refresh" anywhere.

I am seeing a strange response from the App. RestService "Success" works well in PageList, but nothing relating to RestService "Success" or "Complete" works in IntroPage." That means that the variable that I set to collect data only works from one page and not from another. It just hangs there. I need to be able to get data that pertain to IntroPage on that page and vice versa.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Load Sequence and on Condition

[quote:]I couldn't find "Use full screen refresh" anywhere.[/quote]You can tick it when creating a handler like Navigate to page.

Then you would need to learn more about namespaces and use of localStorage.
http://docs.appery.io/tutorials/build...

Return to “Issues”