custom onSortCmd executes many times

Hello all,

Situation : tabpanel containing a form (table view locked) with headers, the form uses a custom onSortCmd method named nb_onSort and has the following lines of code :

var Arg1 = arguments[0] // name
var Arg2 = arguments[1] // true
var $form = application.getMethodTriggerFormName();

if(Arg1 == ‘dummy_dataP’)
{
globals.nav_dc_add();
return;
}

if(Arg2 == true)
{
forms[$form].controller.sort(Arg1 + ’ desc’);
}
else
{
forms[$form].controller.sort(Arg1 + ’ asc’);
}

now when I click on a header en debug the method, I see it runs over and over while I only want the sort executed once, as you can see I also use th e custom onSort to create a (1) new record, but I get between 1 and x new records. The above only occurs when execute from a tabPanel, normal forms do not show this behavior.

Is there something wrong with this code or is this a bug.

I run
Servoy Developer
Version 3.5.5 build 518
Java version 1.5.0_13-119 (Mac OS X)

Best regards,

Peter

Couple of days ago we recieved this as a support case #125599, we look into this shortly…

The problem is not with your code. In some situations it seems that the onSort event was handled multiple times, not just once. For example on forms displayed in tabpanels, and on form displayed in modal windows.

This is fixed now. The fix will be available with the next release of Servoy. The support case #125599 refers to this problem.

Regards,
Gabi.

Thanks for fixing this so rapidly.

gerzse:
The problem is not with your code. In some situations it seems that the onSort event was handled multiple times, not just once. For example on forms displayed in tabpanels, and on form displayed in modal windows.

This is fixed now. The fix will be available with the next release of Servoy. The support case #125599 refers to this problem.

Regards,
Gabi.