Weird tree node behavior (RichFaces + Seam)
elenctic87 Nov 3, 2008 8:40 PMBackground: a dynamic 2-level tree, both levels comprised of data from a Seam session bean. I just want to know which node is selected when a user clicks on it, and then refresh an outputText element with the new selected node. Upon clicking the 2nd-level node the node text changes. See the following video: http://vimeo.com/2147584 Notice how the 2nd tier node content changes every time I select that node. The node listener code in the bean runs, but it does nothing to change the node text as far as I can see. Relevant snippets of code follow below.
Any idea what the problem could be? Remember to watch the video in the link above. Thanks for your insight!
Andrew
p.s. Please don't dismiss this as a Seam problem and tell me to post in another forum. RichFaces is supposed to work with Seam. If you can tell me how to configure Seam differently to work with RichFaces, that would be nice. Or tell me how to configure RichFaces to work with Seam. The point is they aren't working together on this simple task and they need to do so.
Here are the relevant snippets of code:
Facelets:
<a:form ajaxSingle="true" ajaxSubmit="true"> <h:outputText value="Selected Auction #{uifront.curAuctionValue.toString()}" id="selected" /> <rich:tree id="AuctionSelect" switchType="ajax" nodeSelectListener="#{uifront.selectionListener}" ajaxSubmitSelection="true" > <rich:treeNodesAdaptor id="AUCTION" nodes="#{auctionList.resultList}" var="auct"> <rich:treeNode data="#{auct.id}" > <h:outputText value="Auction: #{auct.auctDesc} #{auct.id}" /> </rich:treeNode> <rich:treeNodesAdaptor id="AUCTIONVALUE" nodes="#{auct.auctionValues}" var="avs"> <rich:treeNode data="#{avs.id}"> <h:outputText value="Value: #{avs.value}" /> <a:support event="onclick" reRender="selected"/> </rich:treeNode> </rich:treeNodesAdaptor> </rich:treeNodesAdaptor> </rich:tree> </a:form>
Listener:
@Name("uifront") @Scope(ScopeType.SESSION) public class UiFront { @In protected EntityManager entityManager; ... private AuctionValue curAuctionValue; public void selectionListener(NodeSelectedEvent event) { UITree tree = (UITree) event.getComponent(); AuctionValue av = (AuctionValue) tree.getRowData(); this.curAuctionValue = av; System.out.println ("rowdata: " + tree.getRowData() + " Tree rowdata: " + av.toString()); } ... }