-
1. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
sarocks Jun 30, 2011 1:47 AM (in response to pablo53)Hi,
You can use a4j:commandLink instead of h:commandLink.
It works fine for me!
<h:form> <rich:tree id="tree" nodeType="#{node.type}" var="node" value="#{treeBean.rootNodes}" toggleType="client"> <rich:treeNode type="country"> <a4j:outputPanel layout="block"> <a4j:commandLink value="#{node.name}" action="#{treeBean.actionEvent}" actionListener="#{treeBean.actionListenerEvent}"> </a4j:commandLink> </a4j:outputPanel> </rich:treeNode> </rich:tree> </h:form>
Thanks.
-
2. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
raissi Jun 30, 2011 10:18 AM (in response to sarocks)Hello Saroj,
I am using the same code that you've posted. I obtained the following exception:
Jun 30, 2011 3:10:47 PM org.richfaces.context.ExtendedPartialViewContextImpl processPartialExecutePhase
SEVERE: java.lang.NullPointerException
javax.faces.FacesException: java.lang.NullPointerException
at org.richfaces.component.UIDataAdaptor.invokeOnComponent(UIDataAdaptor.java:1124)
at org.richfaces.renderkit.TreeRendererBase.decode(TreeRendererBase.java:208)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787)
at org.richfaces.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:824)
at javax.faces.component.UIForm.processDecodes(UIForm.java:225)
at org.richfaces.context.PartialViewExecuteVisitCallback.visit(PartialViewExecuteVisitCallback.java:55)
at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:337)
at javax.faces.component.UIForm.visitTree(UIForm.java:354)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
Can you help me with this, please .
Thanks.
-
3. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
sarocks Jun 30, 2011 11:19 AM (in response to raissi)Could you upgrade the JSF libraries to latest release!
I am not sure but it may help.
See the link below, end of the page:
http://javaserverfaces.java.net/nonav/rlnotes/2.1.2/migration.html
Disable partial state saving for the application by specifying a context initialization parameter called
javax.faces.PARTIAL_STATE_SAVING
with a value offalse
. -
4. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
raissi Jun 30, 2011 11:54 AM (in response to sarocks)Hello again,
Thanks for the response,
It's so weird. In fact, when I ommit the a4j:commandLink, the tree works fine.
I tried your solution (disable state saving), but nothing happened.
-
5. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
sarocks Jun 30, 2011 12:24 PM (in response to raissi)Ok. I am not sure why this problem!
Once I got this exception, then I upgraded jsf to 2.1.1 and made the changes in web.xml. Then i never had this issue.
I am using tomcat 6.0.20 and Richfaces 4.0.0.Final
If the code I posted only giving this problem then its weired, because it works for me.
Or else you could do a little googling, may be something else causing this problem, i found something like below:
http://stackoverflow.com/questions/6207800/richtree-nullpointerexception-on-node-click
-
6. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
pablo53 Jul 4, 2011 10:07 AM (in response to pablo53)There MUST be an error in RF 4.1.0
The same problem concerns <h:commandLink> inside a <h:dataTable> which is placed inside a <rich:tabPanel>. If I put it outside <rich:tabPanel> it works, when I put it inside <rich:tabPanel> - it does not.
Regards,
-
7. Re: RF_4.1.0: action and actionListener of <h:commandLink> inside <rich:treeNode>
raissi Jul 4, 2011 10:30 AM (in response to pablo53)Hi Paweł,
Did you specify the value of the "name" attribute inside commandLink ? If not, can you try it ? I had the same issue as yours, but with RF 3.3, When I ommit the name attribute, then, nothing happens when clicking on the link.
I hope this helps,
Best Regards,