Why do you not want the nodes to be selectable? Is it simply for aesthetic reasons? If so, have you considered simply using CSS to disable any styling changes when the node is selected?
Alternatively, a recent forum post (https://community.jboss.org/thread/228490) explores interacting with a tree's selection state, perhaps that post will give you some insight.
Sorry for my late anwer, but the weekend...
Not not only for aesthetic reasons, the user has no right to select (and work) with that node. But he may work with one of the children.
Playing with the css styles will not prevent events to be fired.
Same with handling these restrictions on the server. It is possible, but I want to use the onselectionchange event to close the surrounding popup only when a valid node is selcted.
As I wrote in my question:
Then I tried an "onbeforeselectionchange" JS listener, but I havn't found a n attribute in the event which shows me the source (trreode) of the event.
Sorry, it's late
Does "event.data.newSelection" not contain what you are looking for? If it doesn't it's a bug, please file a jira issue.
similar to the onselectionchange event: empty or null.
and see if you can figure out why the event.data is not as expected?
As far as I can see atm:
The values of the selections are ok in the tree.js, but they will not survive the deepest inner of jQuery.
It will take a bit longer to follow all the packing and upacking of the data
I'm wrong, newSelections isn't empty, my stringify-function shows visited nodes of the hierarchy as "" to avoid infinite loops;
Now I'm in the structure:
So do you have this working now?
var nid = event.rf.data.newSelection.id.id;
return $("div[id='"+nid+"']").find(".nodedisabled").length == 0;