Code: Select all
org.primefaces.component.tree.Tree uiPrimeTree = new org.primefaces.component.tree.Tree();
uiPrimeTree.setId("mytree123");
uiPrimeTree.setWidgetVar("mytree123");
uiPrimeTree.setSelectionMode("single");
uiPrimeTree.setSelection( <<<< OBJECT >>>> ); // here is the ISSUE. It is expected an object here, but there is no "setSelectionValueExpression".
uiPrimeTree.setVar("node");
...
Code: Select all
setValueExpression("selection","#{myBean.mySelectionTreeNode}")
With the above, what happens is the following exception:
SEVERE: java.lang.NullPointerException
at org.primefaces.component.tree.Tree.processUpdates(Tree.java:318)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at org.primefaces.component.tabview.TabView.processUpdates(TabView.java:257)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at org.primefaces.component.tabview.TabView.processUpdates(TabView.java:257)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1242)
at javax.faces.component.UIForm.processUpdates(UIForm.java:281)