onShow property

Hi all,

Servoy Developer
Version 3.1.3-build 407
Java version 1.5.0_06-68 (Mac OS X)

I’m struggling to understand this ‘first time’ concept for the onShow

The method that is triggered EVERY TIME the form is displayed; an argument must be passed to the method if this is the first time the form is displayed. 
Example: 
var firstTime = arguments[0];
if(firstTime == true) doOneTimeInit();

Could anyone provide a simple but practical example of how this first time option could be implemented for a bear of simple brain like myself, please

Cheers
Harry

Hi Harry,

I suppose the idea is that this method, apart from being attached to an onShow formEvent, can also be triggered from an other form script or startup script like this:

forms.targetFormName. onShowMethod(booleanFirstTimeTrueFalse)

the first time concept of a onShow script is there that you can do foundset related stuff on your foundset if you want to do stuff only onces on your data.

It is almost the same as onLoad (also called once) but later in the game. So in onshow everything is there all the data. onLoad is triggered much earlier the right data/foundset isn’t there yet.