Hi,
sorry for the late answer. I'm a little busy this week (and probably
next few weeks). Try to compile and run the attached project and let me
know, whether it work for you (it works for me). It's a NetBeans 6.1
project.
There are just two components - tree and staticText. If you click a
treeNode, the staticText should display the treeNode id.
If it will work, double check binding attribute of tree component in
your project.
If you will not be able to find the problem, try to send me you project
(don't forget to clean it first).
Good luck :-)
Regards
Tony
Giulio Ferro wrote:
> Antonin Karasek wrote:
>> Hi,
>> this is not a solution, but something, that can be helpful...
>>
> Nope, it doesn't work.
> I've tried the dynamic tree example
> http://webdev2.sun.com/woodstock-tlddocs/webuijsf/tree.html
> creating a new project with
> a new Netbeans 6.5 installation both with linux and windows and
> it's useless.
>
> First of all, you have to change the actionListener to
> actionListenerExpression
> of the tree and the action to actionExpression of the button in the jsp,
> otherwise it won't compile. I guess the example in the docs refers to an
> old
> implementation of this component...
>
> Then the getSelected() method _ALWAYS_ returns null, either in the
> button's actionExpression method and in the actionListenerExpression of the
> TreeNode.
>
>
>
>> 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...
>
> It does return null, really null...
>
>>
>> 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;
>> }
>>
> Same as above...
>
>
>> -- I'm using getSelected() in actionExpression with exactly the same
>> configuration (netbeans 6.1 (last update) + glassfish v2 + sun java 6)
>> and it works...
>
> Can you try the example in the docs? Does it work for you?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>
>