-
1. Re: <h:commandLink> and <h:commandButton> not calling action
sergeysmirnov Sep 27, 2007 11:29 PM (in response to mangelo123)make the section bigger :-)
-
2. Re: <h:commandLink> and <h:commandButton> not calling action
sergeysmirnov Sep 28, 2007 2:45 AM (in response to mangelo123)if it does not help try to ask less abstract question
-
3. Re: <h:commandLink> and <h:commandButton> not calling action
alexanderbelov Sep 28, 2007 6:42 AM (in response to mangelo123)What browser do you use? Mozilla FF?
-
4. Re: <h:commandLink> and <h:commandButton> not calling action
mangelo123 Sep 28, 2007 11:54 AM (in response to mangelo123)If I move the h:commandLink outside of the form it works just fine.
-
5. Re: <h:commandLink> and <h:commandButton> not calling action
mangelo123 Sep 28, 2007 12:22 PM (in response to mangelo123)Here is a code snippet I used for testing. If I leave the a4j:commandLink as is when I ui:include it inside the page with the form it DOES NOT work. If I simply remove the a4j and make it a simple h:commandLink it works fine.
<html xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <head> <title>My JSF 'MyJsp.jsp' starting page</title> </head> <body> <f:view> <h:outputText value="This is my JSF JSP page." /> <h:dataTable value="#{links.hyperLinks}" var="link"> <h:column> <h:outputLink value="#{link.url}"> <h:outputText value="#{link.enLink}" /> </h:outputLink> </h:column> </h:dataTable> <h4> Languages </h4> <a4j:commandLink rendered="#{edit_provider.showNewLanguage !=true}" value="Add New Language" reRender="addlangs2" action="#{edit_provider.showNewLanguage}" /> <h:panelGrid id="addlangs2"> <h:panelGrid columns="2" styleClass="outside_border" rendered="#{edit_provider.showNewLanguage}"> <h:selectOneListbox value="#{edit_provider.newLanguage}" size="1"> <f:selectItems value="#{utils.langSelectItems}" /> </h:selectOneListbox> <h:commandLink action="#{edit_provider.addNewLanguage}" value="Add" /> </h:panelGrid> </h:panelGrid> </f:view> </body> </html>
-
6. Re: <h:commandLink> and <h:commandButton> not calling action
mangelo123 Sep 28, 2007 3:24 PM (in response to mangelo123)This problem is happening due to h:commandLink being inside an h:panelGrid.
Has anyone run into this before? -
7. Re: <h:commandLink> and <h:commandButton> not calling action
sergeysmirnov Sep 28, 2007 7:19 PM (in response to mangelo123)You are little bit wrong with your guess. The h:commandLink cannot be work if it is re-rendered outside of the form. This is a nature of h:commandLink, that was designed in pre-ajax era.
BTW, your code snippet has no form on it. It should.
You need to replace h:form with a4j:form and h:commandLink with a4j:htmlCommandLink.
READ:
http://livedemo.exadel.com/richfaces-demo/richfaces/htmlCommandLink.jsf
http://livedemo.exadel.com/richfaces-demo/richfaces/form.jsf