Treenode commandlink actionListener does not work as expected in Netbeans
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Treenode commandlink actionListener does not work as expected in Netbeans  XML
Forum Index -> Tools
Author Message
vveinotte

Joined: 22/03/2007 00:00:00
Messages: 30
Offline


Hi,

I'm using Netbeans 5.5 with VWP and Icefaces 1.5.3 and Sun App Server 8.2.

Trying to follow the tutorial/examples I have derived a class from IceUserObject for my tree nodes and I use it to display label and icons. As shown in the examples, I'd also like to connect an actionListener to a commandLink on the node to be fired when the node is clicked.

The following jsp code works:

Code:
 <ice:commandLink actionListener="#{phaseManager.phasesTree_processAction}" binding="#{phaseManager.commandLink2}" id="commandLink2">
             <ice:outputText binding="#{phaseManager.outputText3}" id="outputText3" value="#{item.userObject.text}"/>
             </ice:commandLink>
 


phasesTree_processAction is called each time a node is clicked.

The follwing does not work and

Code:
 <ice:commandLink actionListener="#{item.userObject.nodeClicked}" binding="#{phaseManager.commandLink2}" id="commandLink2">
             <ice:outputText binding="#{phaseManager.outputText3}" id="outputText3" value="#{item.userObject.text}"/>
             </ice:commandLink>
 

What am I doing wrong?

(note: working and non-working files attached)

 Filename notWorking.jsp [Disk] Download
 Description
 Filesize 7 Kbytes
 Downloaded:  177 time(s)

 Filename working.jsp [Disk] Download
 Description
 Filesize 7 Kbytes
 Downloaded:  220 time(s)

frank.ye

Joined: 26/10/2004 00:00:00
Messages: 709
Offline





Both expression are working as follows:

actionListener="#{phaseManager.phasesTree_processAction}"

actionListener="#{item.userObject.nodeClicked}"

assumes that you implemented

NodeUserObject

public void nodeClicked(ActionEvent event) {
System.out.println("@@ mynode nodeClicked"+event);
}

with following page.


<ice:tree binding="#{Page1.tree1}" id="tree1" style="height: 286px; left: 72px; top: 24px; position: absolute; width: 190px"
value="#{Page1.tree1Model.model}" var="item">
<ice:treeNode binding="#{Page1.treeNode1}" id="treeNode1">
<f:facet name="icon">
<ice:panelGroup binding="#{Page1.panelGroup1}" id="panelGroup1" style="display: inline;">
<ice:graphicImage binding="#{Page1.graphicImage1}" id="graphicImage1" value="#{item.userObject.icon}"/>
</ice:panelGroup>
</f:facet>
<f:facet name="content">
<ice:panelGroup binding="#{Page1.panelGroup2}" id="panelGroup2" style="display: inline;">
<ice:commandLink actionListener="#{item.userObject.nodeClicked}" binding="#{Page1.commandLink1}" id="commandLink1">
<ice:outputText binding="#{Page1.outputText1}" id="outputText1" value="#{item.userObject.text}"/>
</ice:commandLink>
</ice:panelGroup>
</f:facet>
</ice:treeNode>
</ice:tree>

I could change the design time behavior to include commandLink in the next release as well.
[Email]
vveinotte

Joined: 22/03/2007 00:00:00
Messages: 30
Offline


Thanks,

I think I'm beginning to understand where I went wrong. Would you please post the Page1.java source?

Vic
frank.ye

Joined: 26/10/2004 00:00:00
Messages: 709
Offline


I am not sure why it is not working for you. But here is the Page1.java source.
 Filename Page1.java [Disk] Download
 Description
 Filesize 8 Kbytes
 Downloaded:  516 time(s)

[Email]
karakatic

Joined: 23/02/2010 00:00:00
Messages: 1
Offline


i have a similar problem.
Code:
                 <ice:tree id="tree"
                           value="#{Tree.model}"
                           var="item"
                           hideRootNode="#{false}"
                           hideNavigation="#{false}">
                     <ice:treeNode>
                         <f:facet name="content">
                             <ice:panelGroup style="display: inline; #{node.userObject.selected ? 'background-color: white' : 'background-color: black'}">
                                 <ice:commandLink
                                         actionListener="#{item.userObject.selectNode}">
                                     <ice:outputText value="#{item.userObject.text}" />
                                     <f:param name="id" value="#{item.userObject.id}"/>
                                     <f:ajax execute="@this" render="@all" />
                                 </ice:commandLink>
                             </ice:panelGroup>
                         </f:facet>
                     </ice:treeNode>
                 </ice:tree>
 


Code:
     public void selectNode(ActionEvent action){
 ...
     }
 


but selectNode method is never executed. i use ICEfaces 2.0 beta1, with Netbeans, Glassfish 3.0.1. I followed tutorial on tree selection, but it doesn't work.
 
Forum Index -> Tools
Go to:   
Powered by JForum 2.1.7ice © JForum Team