-
1. Re: richfaces 4 - executing an action inside rich:dataTable
healeyb Feb 18, 2012 9:39 AM (in response to barbaraboie)Hi, your code posting didn't work - I find it difficult on the forum myself. Have another go and I'll take
a look at your problem.
-
2. Re: richfaces 4 - executing an action inside rich:dataTable
barbaraboie Feb 18, 2012 4:44 AM (in response to healeyb)Thanks for letting me know, Brendan. Here is the code:
<ui:define name="content">
<h:form>
<h:panelGrid columns="3" id="panelZoekVerenigingen">
<h:outputLabel value="Officiële naam" />
<h:inputText value="#{verenigingManager.zoekVerenigingOfficieleNaam}" styleClass="long">
<h:commandButton value="Zoek" action="#{verenigingManager.zoekVerenigingen}">
<f:ajax render=":formVerenigingen" execute="panelZoekVerenigingen"/>
</h:commandButton>
</h:panelGrid>
</h:form>
<h:form id="formVerenigingen">
<rich:dataTable var="_vereniging" value="#{verenigingManager.verenigingList}" rendered="#{verenigingManager.verenigingList != null}" id="panelVerenigingen">
<rich:column>
<f:facet name="header">Naam</f:facet>
<h:commandButton value="#{_vereniging.officieleNaam}" action="#{verenigingManager.editVereniging(_vereniging)}"/>
</rich:column>
</rich:dataTable>
</h:form>
</ui:define>
-
3. Re: richfaces 4 - executing an action inside rich:dataTable
mcmurdosound Feb 18, 2012 5:15 AM (in response to barbaraboie)Hmmm, try not to (re)render the form directly. This can cause some strange effects like no longer working links or buttons:
<h:commandButton value="Zoek" action="#{verenigingManager.zoekVerenigingen}">
<f:ajax render="formVerenigingen:panelVerenigingen" execute="panelZoekVerenigingen"/>
</h:commandButton>
-
4. Re: richfaces 4 - executing an action inside rich:dataTable
barbaraboie Feb 20, 2012 4:43 AM (in response to mcmurdosound)Hello Christian
I did the change but the action #{verenigingManager.editVereniging(_vereniging)} is still not fired. I've also put everything in one form, but the problem still exists.
barbara
-
5. Re: richfaces 4 - executing an action inside rich:dataTable
barbaraboie Feb 20, 2012 10:29 AM (in response to barbaraboie)I found a solution, I used pretty:link instead:
<pretty:link mappingId="verenigingedit3">
<f:param name="verenigingid" value="#{_vereniging.verenigingID}"/>
<h:outputText value="#{_vereniging.officieleNaam}" />
</pretty:link>
In pretty-config.xml
<url-mapping id="verenigingedit3">
<pattern value="/verenigingedit3" />
<view-id value="/private/verenigingedit2.cjsm" />
<action>#{verenigingManager.editVereniging}</action>
</url-mapping>
In VerenigingManager.java
public String editVereniging() {
Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String id = params.get("verenigingid");
...
}
-
6. Re: richfaces 4 - executing an action inside rich:dataTable
healeyb Feb 21, 2012 1:20 PM (in response to barbaraboie)>> <f:ajax render="formVerenigingen:panelVerenigingen" execute="panelZoekVerenigingen"/>
the problem with this is that panelVerenigingen isn't permanently resident in the DOM because it uses the
rendered attribute. If you wrapped it in a panelGroup and used the id of this as the target of the f:ajax
render= I can't see why it shouldn't work.
Don't do this:
<f:ajax render="panelA"/>
<h:panelGroup id="panelA" rendered="#{bean.showThis}"/>
This is ok:
<f:ajax render="panelA"/>
<h:panelGroup id="panelA">
<h:panelGroup rendered="#{bean.showThis}"/>
</h:panelGroup>
I rarely use multiple forms in the same view (with the exception of dialogs & file upload) just because with
ajax you have control over what gets submitted anyway, and I find myself getting into a naming container
mess otherwise!
Regards,
Brendan.