-
1. Re: CommandLink in Tree does not work until node is selected
nbelaevski Feb 25, 2009 2:18 PM (in response to fritzr)Hello,
No, it's not possible selection happens by "mousedown" event and h:commandLink is submitted by "click" event ("mousedown" + "mouseup"). Please describe why do you need to do this, maybe I'll be able to suggest something? -
2. Re: CommandLink in Tree does not work until node is selected
fritzr Feb 25, 2009 3:29 PM (in response to fritzr)Hi,
I have the following UseCase:
The tree shows machines, systems and subsystems. Based on the selection, another panel is filled with additional information. Thus I need the selectionListener. Another reason for the selectionListener is the use of my context menu, which needs the current node for further processes.
The commandLinks display dxynamic n:m relations, called RiskTypes. With a click on these -items a subflow is started and we proceed with another page.
In some way, you can compare this functionality with a tree table. I figured out, that it might be a solution to use the requestDelay, cause than the click-event will proceed. In general i try to avoid making the application slower than it needs to. See the screenshot attached for an overview.
[img]http://www.fritzr.de/screenshot.jpg[/img]
http://www.fritzr.de/screenshot.jpg -
3. Re: CommandLink in Tree does not work until node is selected
nbelaevski Feb 26, 2009 11:21 AM (in response to fritzr)I suggest that you disable ajax selection submits. Try this:
<rich:tree switchType="ajax" ajaxSubmitSelection="false" nodeSelectListener="#{forum5Bean.processNodeSelection}"> <rich:recursiveTreeNodesAdaptor roots="#{forum5Bean.rootNodes}" var="item" nodes="#{item.children}"> <rich:treeNode><h:commandLink styleClass="treeLink" onmousedown="window.treeLink = true;">#{item.locationName}</h:commandLink> - text <a4j:support event="onselected" onsubmit="if (window.treeLink) {window.treeLink = false; return true;}"/> </rich:treeNode> </rich:recursiveTreeNodesAdaptor> </rich:tree>