Hi,
this is not a solution, but something, that can be helpful...
1. Make sure, that getSelected() really returns null. Try something like:
if (nodeId == null) {
System.err.println("really null");
return "";
}
and watch the glassfish output in NetBeans...
2. Try to call getSelected() in actionExpression of a treeNode:
<webuijsf:treeNode id="folder1" binding="#{TestTreeBean.folder1}"
actionExpression="#{TestTreeBean.myMethod}" />
public String myMethod {
System.err.println("selected:
"+getDynamicTree().getSelected());
return null;
}
-- I'm using getSelected() in actionExpression with exactly the same
configuration (netbeans 6.1 (last update) + glassfish v2 + sun java 6)
and it works...
Good luck :o)
Regards
Tony
Giulio Ferro wrote:
> I've noticed that I'm not able to get server-side the id value
> of the selected TreeNode. I was developing a module and it didn't
> work, so I carbon-copied the example in the docs:
>
> http://webdev2.sun.com/woodstock-tlddocs/webuijsf/tree.html
> (Example 4: Dynamic Tree)
>
> and it didn't work either.
>
> The problem is here:
>
> -------------------------------------------------------------
> | public String addNode() {
>
> String nodeId = getDynamicTree().getSelected();
>
> if (nodeId == null) {
> return "";
> } |
> ....
> -------------------------------------------------------------
>
> The getSelected always returns null, whatever node I click on and then
> press "add child".
>
> I don't know if I'm doing something wrong or there is some issue here...
> I'm using netbeans 6.1 (last update) + glassfish v2 + sun java 6
>
> Thanks for any help.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>
>