-
1. Re: rich:tree doesn't fire selectionChangeListener when using selectionType="client" and toggleType="client"
bleathem Jul 8, 2013 7:01 PM (in response to 68b329da)1 of 1 people found this helpfulThe idea with selectionType="client" is that no server communication is invoked. If you want to trigger a server communication with switchType="client", try using one of the client-side events "onselectionchange" or "onnodetoggle" and a nested a4j:ajax tag.
-
2. Re: rich:tree doesn't fire selectionChangeListener when using selectionType="client" and toggleType="client"
andreaswussler Jul 9, 2013 4:05 AM (in response to bleathem)1 of 1 people found this helpfulIs there a way to fire an change event WITHOUT rerendering the tree to make RequestScope usable, again???
-
3. Re: rich:tree doesn't fire selectionChangeListener when using selectionType="client" and toggleType="client"
bleathem Jul 9, 2013 4:55 PM (in response to andreaswussler)Do you mean "fire a change event" that results in a ajax/server request? The Request Scope spans only a single ajax request, you'll have to use a longer live scope.
-
4. Re: rich:tree doesn't fire selectionChangeListener when using selectionType="client" and toggleType="client"
pbaker01 Jul 18, 2013 10:23 AM (in response to 68b329da)It would help if you could post more of your tree component. Are you executing the tree to force update when you do your function?
Consider this code here:
<rich:tree id="tree" nodeType="#{node.type}" var="node" toggleType="ajax" selectionType="client"> <rich:treeModelRecursiveAdaptor roots="#{itemCategoryController.rootCategoryNodes}" nodes="#{node.children}" leaf="#{node.leaf}"> <rich:treeNode id="branchNode" type="branch" toggleListener="#{itemCategoryController.processTreeToggle}" expanded="#{node.expanded}" iconExpanded="/images/tree/Folder.gif" iconCollapsed="/images/tree/Folder.gif" ondblclick="processBranchSelect()"> #{node.category.categoryName} </rich:treeNode> <rich:treeNode id="treeNode" type="leaf" expanded="#{node.expanded}" iconLeaf="/images/tree/Yes.gif" ondblclick="#{rich:component(mnat:concat(popUpId,'PopUp'))}.hide(); processLeafSelect(); return false;"> #{node.category.categoryName} </rich:treeNode> </rich:treeModelRecursiveAdaptor> </rich:tree> <a4j:jsFunction name="processBranchSelect" actionListener="#{branchSelectActionController[branchSelectAction]}" render="tree" execute="tree" /> <a4j:jsFunction name="processLeafSelect" actionListener="#{leafSelectActionController[leafSelectAction]}" render="#{render}" execute="tree" />
Toggling a branch will automatically fire processTreeToggle because toggleType is ajax... But if I want access to the selection when the user double clicks on a branch or leaf then I have the "execute" the tree to force the update of the selection. See the jsFunction components.
So in your case you have a selectionChangeListener but since you have selection type of client you are going to have to force the tree to be updated by including it in the execute phase then the selectionChangeListener will be invoked. This is my understanding and it work for me.