I noticed a change on the DBTreeView bean behaviour in Servoy 5.1.x.
.setMethodToCallOnClick() executes when setting the .selectionPath of the bean.
Before that didn’t happen, but does now. This results in unwanted behaviour of our navigation system.
Like the .setMethodToCallOnClick() function says: it only should trigger the method when a user CLICKS on the tree, not when setting the path.
I tried to set a flag to prevent the method from firing, but there are just too many ways and variables that set the selectionPath.
I hope this issue can be fixed soon?
did you file a case?
Karel Broer:
I noticed a change on the DBTreeView bean behaviour in Servoy 5.1.x.
As far as I know this is long time behaviour…
If you use this code-snippet as an example to build your own, you’ll sleep well tonight
function nav_showInTree()
{
var $treePath = arguments[0];
// disable standard treeBind
globals.nav.treebind.setMethodToCallOnClick(globals.nav_doNothing, 'k_granted_button_id');
globals.nav.tree.selectionPath = $treePath;
// check expanded state
var $expStatus = globals.nav.tree.isNodeExpanded($treePath);
globals.nav.tree.setExpandNode($treePath, $expStatus);
// enable standard treeBind
globals.nav.treebind.setMethodToCallOnClick(globals.nav_callbackTree, 'k_granted_button_id');
var x = 1;
}
Just some explanation:
- globals.nav_doNothing: just an empty method doing nothing (surprise!)
- the check expanded state is something we do by default, but is optional.
Hope this helps
Harjo:
did you file a case?
Yes I did: case 315486 is created for this.
mboegem:
As far as I know this is long time behaviour…
If you use this code-snippet as an example to build your own, you’ll sleep well tonight
Just some explanation:
- globals.nav_doNothing: just an empty method doing nothing (surprise!)
- the check expanded state is something we do by default, but is optional.
Hope this helps
Your code did help! Thanks Marc!
Nevertheless, it still is a bit of a workaround, so I hope Servoy could still fix the issue in the bean.