Populating labels on a master from a screen.

Paul Bowman shared this question 6 years ago
Answered

Hello I have a requirement to have two labels on a Master. The fields are bound to two variables in a page load event (one for each label). The Master is added to a screen. The screen has two on page load events each reads a field from the same data master and sets the matching variable.


Now on 4.1 this works most of the time occasionally the second field will not be set. On 4.5 this does not seem to work. If I take the second page event out of the screen the first load will work. I believe this should and it is entirely possible I am going about it the wrong way if anyone has a better way to do this please let me now.


I have example projects if needed.

Comments (10)

photo
1

Could you send the example to jim.support at justinmind.com please?

photo
1

OK

photo
1

Hello,


Wondering if there is an update on this issue?

photo
1

Hi Paul,


I checked this with the people at support and they told me they didn't received any email about this. Could you send it again please?

photo
1

Hi


I didn't send an email I was wondering if there was an update to the question I raised specifically is there a solution?


I sent an email with the example prototypes last Monday.


Thanks


Paul

photo
1

Hi Paul,


We have checked it and we don't have any .vp file in our email. Could you send it again please?

photo
1

Ok sent again

photo
1

We checked the prototype and the problem is the order the onpage load events are executed. The ones in the screen and the ones in the master are executed in a random order. So in your case i would add a 'pause' action in the 'value 2' onpageload in the master so the simulation has enough time to initialize the variable. Something like this:


4b829933bc990f7f958987ced862add1

photo
1

Ok I will try that.


Is that randomly by Just in mind or random by something I have done?

photo
1

By Justinmind. You can't control which onpageload events will be triggered first, if the ones assigned to a component or the ones assigned to another component. That's why it's a good practice to define all the onpageload events on the page itself. That's what you did already but, of course, you can't define the onpageload events for the things in the master in the screen. So you can't assure which ones will be triggered first, if the ones in the page or the ones in the master's components.