-
1. Re: Richfaces tree control setting value of control in treeN
nbelaevski Sep 18, 2008 10:33 AM (in response to hansfl)Hans,
Do you have the same values of rendered attribute when processing request and rendering response? Can you please minify the sample and post page/bean code?
About click event stopped: what is your RF version? -
2. Re: Richfaces tree control setting value of control in treeN
hansfl Sep 18, 2008 12:51 PM (in response to hansfl)Hi,
I got the problem with the values being set solved.
There was a problem with the name of the html input that was used to hold the value,
so the value is still set but with the correct value so ValueChangeListeners are not called on each request.
I have been using FR 3.2.1 GA and I updated to 3.2.2 GA today.
The issue with the click event is still present.
Today I also notised some other issues. (With both 3.2.1 and 3.2.2).
The values in the displayed nodes are not always being updated when the underlying model is changing.
I have verified that the values in the model is correct, and even after refreshing the page, the value in the treenode from the "old" tree node item is still there.
From what I have seen so far it is the first level as defined in the "roots" attribute in the recursiveTreeNodesAdapter that is not being updated.
Then its children are fine. But then its children again sometimes have the same problem.
My JSF code is below.<rich:tree id="uitree" binding="#{todoPageBean.toDoTree}" style="width:100%" switchType="ajax" rowKeyVar="rowKey" nodeSelectListener="#{todoPageBean.nodeSelected}" onselected="rtnOnNodeSelection(event)" adviseNodeSelected="#{todoPageBean.adviseNodeSelected}" adviseNodeOpened="#{todoPageBean.adviseNodeOpened}" dropListener="#{todoPageBean.nodeDropped}" changeExpandListener="#{todoPageBean.nodeExpandCollapse}" > <rich:recursiveTreeNodesAdaptor id="itemNode" var="itemNode" nodes="#{itemNode.children}" roots="#{todoPageBean.treeModel.root.children}" > <rich:treeNode rendered="#{itemNode.nodeType.class.name == 'com.mycompany.model.tree.RtnDefaultNodeType'}" onkeyup="rtnDoTreeNodeAction(event, this)" id="deftreenode" dragType="default" acceptedTypes="default, resource" > <rich:inplaceInput value="#{itemNode.name}" id="deftreenodeinput" onviewactivated="rtnDefToDoEditComplete(event)" inputWidth="300px" selectOnEdit="true" styleClass="content" viewClass="content" viewHoverClass="content" changedClass="content" changedHoverClass="content" controlClass="content" controlHoverClass="content" controlPressedClass="content" editClass="content" editEvent="ondblclick" style="background-color: #{itemNode.nodeType.colour}"/> <rich:dndParam name="defdraglabel" type="drag" value="#{itemNode.name}" /> </rich:treeNode> <rich:treeNode id="listlookuptreenode" rendered ="#{itemNode.nodeType.class.name == 'com.mycompany.model.tree.RtnListLookupNodeType'}"> <h:panelGrid columns="2" columnClasses="lookupCol1, lookupCol2"> <h:outputLabel styleClass="content" value="#{itemNode.tableName}: " /> <rtn:multiValueSelect id="lookuptreecontrol" width="400" tableName="#{itemNode.tableName}" fieldName="name" valueChangeListener="#{todoPageBean.subNodeNamesChanged}" onBeforeChange="rtnSetSelectedFromLookupControl" value="#{itemNode.value}" query="#{itemNode.tableQuery}" > <a4j:support event="onChange" reRender="#{todoPageBean.defaultReRender}" /> </rtn:multiValueSelect> </h:panelGrid> </rich:treeNode> <rich:treeNode> </rich:treeNode> <rich:treeNode id="defedittreenode" rendered="#{itemNode.type == 'edit'}"> <h:inputText value="#{itemNode.name}" styleClass="content" style="width:100%" onkeydown="rtnSubmitNode(this, 'frm-todo-mng:cmdSaveTreeNode')" onmousedown="rtnSelectNodeForParent(this)" /> </rich:treeNode> </rich:recursiveTreeNodesAdaptor> </rich:tree>
Another thing I am having a bit of problems with is selecting a node just before an ajax request is sent.
When the valueChangeListener of the rtn:multiValueSelect component is called,
it is called before the nodeSelectListener function defined in the rich:tree component.
This way I do not get the currently selected node when in the valueChangeListener function.
Is there a way to define in which order these event functions are called?
Thanks alot for your help.
Hans