-
-
2. Re: ReRender of a4j:include
shooali Jan 8, 2008 5:39 AM (in response to shooali)I have noticed that if I open the modalpanel and does not navigate to the next stage, close the modal panel and open it again, the getter for startStage viewid used in the a4j:include is called. However, if I open the modal panel, click next to navigate to the next stage, close the modal panel and click to open it again, the getter in the viewId property of the a4j:include is called at all and the modal panel opens to the last stage it was on when closed.
-
3. Re: ReRender of a4j:include
shooali Jan 8, 2008 11:55 AM (in response to shooali)I have prepared a full example, outside of our main app.
If I click the "openFirst" button, the MP open to the first stage, then click the "second" button - it navigates to the second stage, close the MP. click "openFirst" again and it opens to the second stage.
please tell me what am I doing wrong.
thanks,main page: <!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" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:c="http://java.sun.com/jstl/core" xmlns:rich="http://richfaces.ajax4jsf.org/rich"> <ui:composition> <a4j:log hotkey="G"></a4j:log> <rich:modalPanel id="trmp" width="600" height="600"> <f:facet name="header"><h:outputText value="Modal Panel"/></f:facet> <f:facet name="controls"> <a href="#" onclick="Richfaces.hideModalPanel('trmp')">X</a> </f:facet> <h:panelGroup id="wizardPanel"> <a4j:include id="wizard" viewId="#{richTestBean.startStage}"/> </h:panelGroup> </rich:modalPanel> <h:form> <a4j:commandButton actionListener="#{richTestBean.defineFirstStartStage}" reRender="wizardPanel" oncomplete="Richfaces.showModalPanel('trmp')" value="openFirst"/> <a4j:commandButton actionListener="#{richTestBean.defineSecondStartStage}" reRender="wizardPanel" oncomplete="Richfaces.showModalPanel('trmp')" value="openSecond"/> </h:form> </ui:composition> </html> First wizard stage: <!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:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:composition template="/stage_template.xhtml"> <ui:define name="body"> <h:outputText value="first"/> </ui:define> </ui:composition> </html> second wizard stage: <!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:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:composition template="/stage_template.xhtml"> <ui:define name="body"> <h:outputText value="second"></h:outputText> </ui:define> </ui:composition> </html> wizard stage template: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"> <ui:composition> <h:form> <table> <tr> <td> <ui:insert name="body"/> </td> </tr> <tr> <td> <a4j:commandButton action="first" value="first" reRender="wizardPanel"/> <a4j:commandButton action="second" value="second" reRender="wizardPanel"/> </td> </tr> </table> </h:form> </ui:composition> </html> page bean: import javax.faces.event.ActionEvent; public class RichTestBean { private String startStage = "/first.xhtml"; public RichTestBean() { } public String getStartStage() { return startStage; } public void defineFirstStartStage(ActionEvent event) { this.startStage = "/first.xhtml"; } public void defineSecondStartStage(ActionEvent event) { this.startStage = "/second.xhtml"; } } faces-config: <?xml version="1.0" encoding="UTF-8"?> <faces-config version="1.2" .......> <managed-bean> <managed-bean-name>richTestBean</managed-bean-name> <managed-bean-class>RichTestBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>second</from-outcome> <to-view-id>/second.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>first</from-outcome> <to-view-id>/first.xhtml</to-view-id> </navigation-case> </navigation-rule> <application> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> </faces-config>
-
4. Re: ReRender of a4j:include
ilya_shaikovsky Jan 9, 2008 6:10 AM (in response to shooali)will this works as excpected if you just write viewId="/first.xhtml" just on the page?
-
5. Re: ReRender of a4j:include
shooali Jan 9, 2008 7:17 AM (in response to shooali)of course not. I want the wizard to open to a stage according to the button you click. If click the "openFirst" to start in the first stage and if clicked the "openSecond" to start in the second stage. If I put viewId="/first.xhtml" it will always open in the first stage.
-
6. Re: ReRender of a4j:include
shooali Jan 10, 2008 6:58 AM (in response to shooali)Hi,
If this cannot be done, please let me know if there's a workaround.
thanks,