OnPageLoad event handling

Hamid Raza shared this question 27 days ago
Answered

Hi,

I want to get little information about handling the behavior of OnPageLoad event in Justinmind simulation. Let me explain by an example:

Suppose you have 20 dynamic panels on a screen and want to assign some calculated width to all of them when the page loads. I can do it in two ways right now; First, add OnPageLoad event on screen and apply the calculated width to all dynamic panels. Second, add OnPageLoad event on all panels individually and apply the calculated width.

Both methods have their own pros and cons, suppose in the first case, if I do it at screen level I have to select all components in prototype, suppose I have 100+ components I can't do in so detail. in the second case, there will be individual OnPageLoad event call on 100+ components.

I want to ask, How you handle OnPageLoad event in JIM simulation. Is it just one call for both cases or 100 calls for the second case? Which method is performance-optimized and effective?

Comments (3)

photo
1

The first method - where all of the panels are selected in one event - would be more effective in this case.

photo
1

Sure, but you didn't tell me how do you handle multiple calls of a function in JIM simulation?

photo
1

In general it's not an issue whatever way they're created unless they have conflicting actions - i.e. one on page load event changes the value of a text, but another on page load event changes the same text to another value.

photo