This content has been marked as final.
Show 3 replies
-
1. Re: Tree selection is always remembered?
andrew.rw.robinson Mar 23, 2007 11:52 AM (in response to andrew.rw.robinson)Looks like I may get no help on this issue, but will try to provide updates. With the client debugging, I found the potential issue. The selected node is stored in the "[treeID]:input" control. This control is not always rendered in the response as seen here:
debug[9:45:44,077]: call getElementById for id= testForm:testTree:input error[9:45:44,078]: New node for ID testForm:testTree:input is not present in response
As a result, the existing one is left in the page which still has the value of the last submitted node. Therefore, this value is included in all future AJAX requests, and during the decode phase of the tree, the tree thinks that the node has be re-selected every time.
I will keep looking into this to see if there is a hack/work-around to force this element to be refreshed, and at the very least I can use the oncomplete to clear the input value. This is the culprit HTML element:<input id="testForm:testTree:input" name="testForm:testTree:input" value="testForm:testTree:H:PagedTreeNode.movePrevious" type="hidden">
-
2. Re: Tree selection is always remembered?
andrew.rw.robinson Mar 23, 2007 12:07 PM (in response to andrew.rw.robinson)Some more information
The TreeRendererBase.java at line 389 has this code:if (value != null) { variables.setVariable("selectionId", value); } else if (rowKey == null) { variables.setVariable("selectionId", ""); }
What happens is that when the tree is AJAX rendered, and the selection has been cleared, the rowKey is always != null for each iteration of this code and the value is always null (since the selection has been cleared). As a result, "encodeSelectionStateInput" method never encodes the INPUT element as it only renders it if the selectionId variable value is not null (which it is in my case of attempting to clear the selected value of the tree). -
3. Re: Tree selection is always remembered?
andrew.rw.robinson Mar 23, 2007 12:32 PM (in response to andrew.rw.robinson)Determined that this is a bug/limitation with the AJAX re-rendering:
http://jira.jboss.com/jira/browse/RF-34