onRecordSelection callback is fired on form restore

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

onRecordSelection callback is fired on form restore

Postby rossent » Fri Feb 10, 2012 7:03 pm

Hi Servoy,

If the current/selected record index of a form foundset is for example 7, and Servoy automatically unloads the form, when the form is restored/reloaded in its onLoad callback the form foundset state is restored and its current/selected record index is still 7, however Servoy fires the onRecordSelection anyway - even though the record selection did not change.

Is this a bug or intended behavior? Why onRecordSelection is fired in this case - the selection did not really change?

If you try something like this: foundset.setSelectedIndex(foundset.getSelectedIndex()) - basically setting the selected index to the same value, the onRecordSelection callback is not fired (which is to be expected). We are having problems with this erroneous onRecordSelection callback during form automatic re-load because we need certain code to be executed only once when the selection is changed and there is no way to distinguish if the onRecordSelection was fired due to a "genuine" selection change or because of that form re-load.

Any information on this will be appreciated.
Rossen Totev
Argos Software
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Re: onRecordSelection callback is fired on form restore

Postby jcompagner » Thu Feb 16, 2012 5:19 pm

This is i guess because for that form the record is "selected" and viewed.
Its not that the selection for the foundset changes (so data level) but the "selection" in the view does change, the form gets a record change (null->record)
Johan Compagner
User avatar
Posts: 8083
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 3 guests