[RESOLVED] How to set default values in elements on page load by data from previous page


#1

Hi,

I am trying to get some data entered by users in page #1 to page#2 so that when the user navigates to page#2, the values are pre-populated on page load. I could not find a onload event. I have defined page2 variable as required and on the go to page event from page 1 set the variable in page2 but how do I get the value of the variable in page2 to show up in the text element on page #2.

Is there a onload event that I could invoke and use setvalue feature ?

Thank you for your time.


#2

Great question and good job describing the issue, @ssksubash .

There are page events for when the page appears/starts/pauses etc. Tap on the page element hierarchy tab on the right side of the platform when you are displaying Page2. Click on the page (highest level) item and then click Events and you’ll see the lifecycle events there that you can tap into. That’s where you can set labels to the variables you’ve passed over.


#3

Worked like a charm. Thank you @wade


#4

Wonderful to hear. Thanks for asking and explaining the situation well. Keep up the great work.


#5

@wade, I have been using your suggestion and it has been working great in transferring the values form page to page. I am trying to do the same for some images and when I create a variable in page2 and choose android and the corresponding image view type, my app is crashing. I also tried java object and I see the same issue. What is the variable type that I can use to transfer images form page to page.

Thank you