-
1. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
ilya_shaikovsky Apr 13, 2011 4:39 AM (in response to nikh123123)if it will works if you will change
rendered="#{userBean.popup}"
to just
rendered="#{true}"
for test?
-
2. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
nikh123123 Apr 13, 2011 4:46 AM (in response to ilya_shaikovsky)@Ilya
Nope.
rendered="#{true}"
gives same behavior.
-
3. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
ilya_shaikovsky Apr 13, 2011 5:03 AM (in response to nikh123123)anything logged in server log?
looks like some weird configuration issue. can't reproduce at rf-showcase environment.
-
4. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
nikh123123 Apr 25, 2011 7:12 AM (in response to ilya_shaikovsky)Apart from the following
14:46:54,333 INFO [TomcatDeployment] deploy, ctxPath=/regiontest
14:46:54,390 INFO [config] Initializing Mojarra 2.0.4 (FCS b09) for context '/regiontest'
14:47:03,361 INFO [Cache] Selected fallback cache factory
14:47:03,362 INFO [Cache] Creating LRUMap cache instance using parameters: {com.sun.faces.duplicateJARPattern=^tmp\d+(\S*\.jar), org.richfaces.skin=myskin, com.sun.faces.injectionProvider=org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider, org.richfaces.fileUpload.maxRequestSize=1000000, javax.faces.PROJECT_STAGE=Development, maxFilesQuantity=1, uploadRepositoryPath=/tmp, org.richfaces.fileUpload.createTempFiles=false, javax.faces.STATE_SAVING_METHOD=server}
14:47:03,370 INFO [Cache] Creating LRUMap cache instance of 512 items capacity
14:47:03,397 INFO [Application] by , version v. SVN r.
14:47:03,402 INFO [config] Monitoring jndi:/localhost/regiontest/WEB-INF/faces-config.xml for modifications
Nothing unusual! Do you want me to paste my web.xml and WEB-INF/lib contents?
-
5. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
mohamida Apr 14, 2011 3:30 AM (in response to nikh123123)me too i have the same problem.
i migrated from richfaces 3.3.3 to 4, and the "action" won't work only after i clicked once.
-
6. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
nikh123123 Apr 13, 2011 2:02 PM (in response to mohamida)@moda, You mean with the onclick set you had an issue calling the action, so you removed it and it worked? On the first click?
AFAIK, you should have
action="#{yourBean.methodName}"
oncomplete="#{rich:component('popup')}.hide();"
In order to execute both successfully.
-
7. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
mohamida Apr 14, 2011 3:33 AM (in response to nikh123123)i modified my message (what i meant with what i said is that i spent much time to figure that the problem is that i have to click 2 times the button so that the "action" will be executed. In fact, before reading your post, i thought that the action isn't executed because of the oncomplete attribute)
-
8. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
nikh123123 Apr 14, 2011 3:44 AM (in response to mohamida)ohh ok I got it now.
Well I took a workaround for now. My code is as follows
<h:body>
<h:form>
<a4j:commandLink value="pop me" execute="@this" render="pgAddWrapper">
<f:setPropertyActionListener target="#{userBean.popup}" value="true"/>
</a4j:commandLink>
</h:form>
<rich:popupPanel
id="addPanel"
modal="true"
autosized="true"
rendered="#{userBean.popup}"
show="#{userBean.popup}"
moveable="true">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Pop me!"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:form>
<a4j:commandLink
execute="@this"
value="X"
oncomplete="#{rich:component('addPanel')}.hide(); return false;">
<f:setPropertyActionListener target="#{userBean.popup}" value="false"/>
</a4j:commandLink>
</h:form>
</f:facet>
<h:panelGroup id="pgAddWrapper">
<h:panelGrid rendered="#{userBean.showAddExpensePopup}">
... < actual data bound components like inputText, inputArea here> ..
</h:panelGrid>
</h:panelGroup>
<h:form>
<a4j:log />
<a4j:commandButton
id="btnSave"
execute="@form"
value="Save"
action="#{userBean.sayHello}"/>
</h:form>
</rich:popupPanel>
</h:body>
So the key change here is instead of re-rendering the whole popup, i just loaded the contents (i.e. components which interact with user, other than buttons) lazily. In this case the a4j:commandButton works as expected.
-
9. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
mohamida Apr 14, 2011 5:13 AM (in response to nikh123123)i have this:
<rich:popupPanel id="popup" width="380" height="200" >
<f:facet name="header">
<h:panelGroup>
Confirmation
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">
<h:graphicImage value="../IMAGES/close.png" height="16" width="16" styleClass="hidelink" id="hidelink"/>
</h:outputLink>
</f:facet>
<h:panelGroup id="panelGrid">
<table style="width: 100%">
<tr>
<td style="font-size:16px;" align="right">
Compte n°
</td>
<td style="font-weight:bold;font-size:16px;" align="left">
#{ordreA.cpt.numCpt} - #{ordreA.cpt.libCpt}
</td>
</tr>
<tr>
<td align="right" colspan="2">
<h:form id="forme2_saisieVente">
<h:panelGroup>
<a4j:commandButton
action="#{ordreA.acheter}"
id="ouiBoutton"
value="Oui"
render="refOrd,estim,sldTrv,sldAch,valeurCh,acheterBoutton,champMessages,imprimerButton"
style="width:55px;height:30px;"
onclick="#{rich:component('popup')}.hide();">
</a4j:commandButton>
<span style="width:10px;"></span>
<a4j:commandButton
action="#{ordreA.annuler}"
id="nonBoutton"
value="Non"
render="champMessages"
style="width:55px;height:30px;"
onclick="#{rich:component('popup')}.hide();">
</a4j:commandButton>
</h:panelGroup>
</h:form>
</td>
</tr>
</table>
</h:panelGroup>
</rich:popupPanel>
when i removed <h:panelGroup id="panelGrid">, everything worked fine.
I don't know why this happened.
-
10. Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
ilya_shaikovsky Apr 15, 2011 10:27 AM (in response to mohamida)It's happened because panelGroup by default rendered as span and you have block elements inside. So generated HTML was not valid. you could add layout=block attribute next time to workaround it.
-
11. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
eduacsp2 Jun 6, 2011 9:07 AM (in response to ilya_shaikovsky)Im still get the same problem with this:
>
"
oncomplete="#{rich:component('editPane')}.show()">>
.
.
.
<
>
>
"Salvar"
"table"
"editPane"
/>
"Cancel"
/>
>
</
>
-
12. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
gomul.mind Jun 8, 2011 11:43 AM (in response to nikh123123)Guys,
I'm facing the same initial issue and I think Eduardo as well,
problem is on popup panel, when button inside the popup panel is click no action is executed, we have to wait until second click to have the action trigered:
In this simple case, when we click on button cloneOrder, 'myModalPanel' is showed. then in the popup panel if I click on Clone button nothing is triggered the first time, second, third .... does.
Any idea?
Many thanks
<a4j:commandButton id="cloneOrder"
value="clone"
render="myModalPanel"
oncomplete="#{rich:component('myModalPanel')}.show()" />...
<rich:popupPanel id="myModalPanel" modal="true" moveable="false"
resizable="false" autosized="true">
<f:facet name="header">
<h:outputText value="Order Clonning" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('myModalPanel')}.hide(); return false;">X</h:outputLink>
</f:facet>
<h:form id="myModalPanelForm">
<h:panelGrid columns="2">
<a4j:commandButton value="Clone"
execute="@this"
action="#{layoutDataBean.cloneOrder}"/>
<a4j:commandButton id="cancelCloneButton" value="Cancel"
onclick="#{rich:component('myModalPanel')}.hide();return false;"/>
</h:panelGrid>
</h:form>
</rich:popupPanel> -
13. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
noelmarin Jun 16, 2011 10:38 AM (in response to gomul.mind)Alf, I had the same issue and the solution for me was the answer number 8 of this post, about not putting in the a4j:commandButton render attribute the popupPanel id, otherwise put the id of the other container.
For your case create other container inside the popupPanel form, for instance an a4j:outputPanel or a h:panelGrid with an id, then put that id in the render attribute of the a4j:commandButton id="cloneOrder", and take special attention to the container of the commandButton that execute the action outside of the container mentioned before.
I hope you understant
-
14. Re: Richfaces 4 - a4j:commandButton inside a lazily loaded rich:popupPanel doesn't execute first time
julio49 Jun 17, 2011 5:04 PM (in response to nikh123123)I am having the same problem as Alf post #12. I call a popup panel, I enter data and click a <a4j:commandButton> and it calls the action function from the managed bean fine. If I close the popup panel and reopen the popup and try to click the <a4j:commandButton>, the action function is not call the the first time but it will the second time I click the <a4j:commandButton>
Here is an example code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<body>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
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">
<rich:panel header="Comments" headerClass="text"
style="height:320px; width:100%;">
<h:inputTextarea value="#{commentsBean.listCommentsForOperation}"
style="height:240px;width:100%;font-size:12pt;" readonly="true"
id="operationCommentsTable" />
<h:commandButton value="Add Comments" style="font-size:12pt;"
onclick="#{rich:component('operationCommentsPopup')}.show()" >
</h:commandButton>
<rich:popupPanel id="operationCommentsPopup" modal="true"
autosized="true" resizeable="false" style="text-align:center;">
<f:facet name="header">
<h:outputText value="Comment Upload" styleClass="text" />
</f:facet>
<f:facet name="controls">
<a4j:commandLink value="X"
oncomplete="#{rich:component('operationCommentsPopup')}.hide(); return false;"
style="font-size:14pt;color:#FFFFFF;"
render="operationCommentsPopupForm" />
</f:facet>
<h:form id="operationCommentsPopupForm">
<h:panelGrid id="commentinputpanel" columns="2" border="0">
<h:outputText value="Comments:" styleClass="text" />
<h:inputTextarea value="#{commentsBean.comment}" cols="75"
rows="8" required="true" id="inputComment">
<rich:validator />
</h:inputTextarea>
<h:outputText value="" />
<rich:message for="inputComment" />
</h:panelGrid>
<a4j:commandButton value="Save Comment" id="savecommentbtn"
action="#{commentsBean.saveOperationCommentsFunction}"
render="operationCommentsTable,errorPopup" style="font-size:14pt;">
</a4j:commandButton>
<div style="width:100%;text-align:center;"><h:outputText id="commentSubmitStatus"
value="#{commentsBean.submitStatus}" style="font-size:10pt" /></div>
</h:form>
</rich:popupPanel>
</rich:panel>
</ui:composition>
</body>
</html>
Any suggestion on how to resolve this issue?