tree does not invoke selectionChangeListener in popupPanel
----------------------------------------------------------

                 Key: RF-11138
                 URL: https://issues.jboss.org/browse/RF-11138
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: component-tree
    Affects Versions: 4.0.0.Final
         Environment: WinXP; JBoss 6.0.0.Final; RichFaces 4.0.0 
            Reporter: Bastian Ulke


I am having a tree for a selection of a node. To monitor a selection, I 
initialized the attribute "selectionType" to "ajax", added the attribute 
"selectionChangeListener" and made it point to a method of a managed bean. 
Everyhting is working extremely well, if I put the tree onto the form straight 
away: Everytime, a node is selected, the method is invoked and I get all the 
information I need to determine the selected node. The definition is as follows:

        <rich:tree var="item"  
                id="tree2"
                selection="#{treeController.selection}" 
                selectionType="ajax"
                selectionChangeListener="#{treeController.selectionChanged}" 
                rendered="true"> 

Now, I want to have the same tree in a popup panel. All I do is wrapping a 
<rich:popupPanel id="abc2"> around it (so no moving to another place - both 
elements are directly located under the <h:form> node). Surprise: Nothing 
happens when a node is selected in the popup panel, the method, indicated in 
selectionChangeListener is never invoked. I remarked, that also the hidden 
input element form:tree2__SELECTION_STATE never changes its value throughout 
selecting differnt nodes.

Intersting: Adding toggleType="ajax" and 
toggleListener="#{orgTreeController.toggle}" to the same tree, works well in 
both cases.


Workaround:
1. Switch selectionType to "client"
2. Add a jsFunction and extend the controller with a property to accept the 
selected node's id
        <a4j:jsFunction name="jsSetSelectedId">
                <a4j:param name="name" assignTo="#{treeController.selectedId}"/>
        </a4j:jsFunction> 
3. Add a panel to the node's content and call the jsFunction from above in the 
onclick event
        <rich:treeNode>
                <a4j:outputPanel layout="block" 
onclick="jsSetSelectedId('#{item.id}');return true;">
                ...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to