Page 1 of 1

Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 8:20 am
by abigdreamer

2nd screens require Memory variables to populate values when 1st screen gets the data from a rest service This requires of ton of extra work.


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 8:40 am
by Kateryna Grynko

Hi Mike,

You can use localStorage to pass values.


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 9:09 am
by Kateryna Grynko

The fact is that the pages can have different address i.e. be different documents. In the transition between the documents the JS code runtime is reset, that is, all variables are lost.

Next, there is the concept of variables scope. If you deliberately turn on the option to display all pages in the same document, the global scope is accessible from all pages of the application.

The best programming practices considered that using global scope unless absolutely necessary is a bad idea, because it complicates debugging and fraught with errors difficult to identify.


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 9:14 am
by abigdreamer

Form2.rerunrest.refresh(form1.field1.value)

Somehow let me RERUN the rest service and refresh all the values based on key put into form1.

Or give me FORM sets, that work as pages and are connected.


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 9:15 am
by abigdreamer

Do you have any idea how many hours of work it takes to do this manually when I go to page 2 ()


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 9:16 am
by abigdreamer

Just because you don't have a simple command that refreshes the values on form 2 your forcing me to make 50 variables and connect everything and put 50 new REFRESH conditions in the page change. THats like days of work for each form. Am I missing something here?


Your makings us do extra work! 2nd screen values not coming from 1st screen

Posted: Mon Aug 05, 2013 2:05 pm
by Kateryna Grynko

Hi Mike,

Yes, you do not take into account that the pages can be really separate and all variables are removed without a trace.

Still, you forget that on service Success event you can save the entire service response in localStorage in one line:
codelocalStorage.setItem( "response_from_mega_service_on_page1", JSON.stringify( arguments[0] ) );/code

If you want to use mapping for this saved response on the second page - create a Generic Service, where as a response {} pass to the Success event JSON.parse (localStorage.getItem ("response_from_mega_service_on_page1").

However, to collect the full range of all response fields, you would need to pass one of the service responses through echo to generate a response structure. I.e. you will need to insert one of the answers as JSON-response text as echo reply and click Automatically create a Response map. Thereafter echo mode should be turned off.