Form caching

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Form caching

Postby pbakker » Thu Jul 15, 2004 11:49 am

Hi,

I read somewhere in one of the topics on the forum that Servoy caches forms, up to 25 or 50 forms. After that, forms are removed from the cache, as to keep the memory usage to an acceptible level. When the form is needed again, it will be reloaded.

Now, I was wondering: will the onLoad method for that form be fired again in the situation that is was loaded before, then thrown out of the cache and then has to be loaded again?

I do not have an immediate issue with it now, but I could think or situations where firing the onLoad method again could result in undesired behaviour, because of the content of the onLoad method.

Just thinking here.....

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby jcompagner » Sat Jul 24, 2004 11:17 pm

yes the onLoad method will be triggered again
as does the onShow method with the first time boolean argument to true.

if you have an example of what can go wrong then. please post this. I will look if we can fix that somehow and if that is doable in all cases.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Sun Jul 25, 2004 2:12 pm

The only issues I see now are when you preset global variables in the onLoad/onShow methods.

Then, if the user/solution during operation alters the variables and the a form is reloaded again, the variables would be updated again.

But I guess this is just something you have to keep in mind designing the methods.

Tnx for the info.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby jcompagner » Sun Jul 25, 2004 3:37 pm

first time global setting should be done in the solution startup method
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 32 guests

cron