-
1. Re: a bug in modalPanel that <h:commandButton action won't t
ilya_shaikovsky May 31, 2007 6:58 AM (in response to vh)do you need to navigate inside the included window or close it and make navigation?
-
2. Re: a bug in modalPanel that <h:commandButton action won't t
vh May 31, 2007 12:17 PM (in response to vh)In the last step of the wizard (in the included page), if the action succeed, I want the action method to return a string to make the page navigate to the first step, if fail, I want to return a different string to make the page stay in the current page.
-
3. Re: a bug in modalPanel that <h:commandButton action won't t
ilya_shaikovsky Jun 1, 2007 5:43 AM (in response to vh)Oh.. sorry missed from your code - your panel with
any action components inside should have a form inside to be submitted. And it should be placed outside from external form in this case. -
4. Re: a bug in modalPanel that <h:commandButton action won't t
vh Jun 1, 2007 6:46 PM (in response to vh)It still doesn't work.
===================
<rich:modalPanel id="addDesktopMp" minHeight="280" minWidth="300"
height="400" width="1000" zindex="2000">
<f:facet id="modalHeader" name="header">
<h:outputText id="modalTitle" value="#{bundle.AddDesktop}" />
</f:facet>
<h:panelGroup id="wizard">
<a4j:include id="includeId"
viewId="/pages/desktop/addDesktopType.xhtml" />
</h:panelGroup>
</rich:modalPanel>
=======================
The included page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h:form id="reviewForm"
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:rich="http://richfaces.ajax4jsf.org/rich">
<f:loadBundle basename="com.vmware.vdi.admin.ui.messages.MessageBundle" var="bundle"/>
<a4j:keepAlive beanName="desktopBean" />
<h:outputText value="#{bundle.ReadyToComplete}"/>
<h:outputText value="#{bundle.ReviewInstruction}"/>
<rich:panel>
<h:outputText value="#{bundle.DesktopTypeColon}" />
<h:outputText value="#{desktopBean.type}" />
<h:outputText value="#{bundle.DesktopIdColon}" />
<h:outputText value="#{desktopBean.id}" />
<h:outputText value="#{bundle.DesktopDisplayNameColon}" />
<h:outputText value="#{desktopBean.displayName}" />
<h:outputText value="#{bundle.VirtualCenterServerColon}" />
<h:outputText value="#{desktopBean.vcName}" />
<h:outputText value="#{bundle.VirtualMachineSelectionColon}" />
<rich:dataList value="#{desktopBean.selectedVMNames}" var="vm">
<h:outputText value="#{vm}"/>
</rich:dataList>
</rich:panel>
<rich:spacer height="20px">
</rich:spacer>
<a4j:commandButton action="back" value="#{bundle.Back}" reRender="wizard"/>
<rich:spacer width="5px"></rich:spacer>
<a4j:commandButton value="#{bundle.Finish}"
action="#{desktopBean.addDesktop}"
oncomplete="Richfaces.hideModalPanel('addDesktopMp');"
reRender="wizard,myTable,myTree"/>
<rich:spacer width="5px"></rich:spacer>
<a4j:commandButton
action="cancel"
actionListener="#{desktopBean.cancel}"
value="#{bundle.Cancel}"
oncomplete="Richfaces.hideModalPanel('addDesktopMp');"
reRender="wizard"/>
</h:form>
=====================
bean method
public String addDesktop() {
return "finish";
} -
5. Re: a bug in modalPanel that <h:commandButton action won't t
vh Jun 5, 2007 1:57 PM (in response to vh)Can somebody help? Did anybody has done this before?
-
6. Re: a bug in modalPanel that <h:commandButton action won't t
ilya_shaikovsky Jun 5, 2007 2:11 PM (in response to vh)Please repeat your snipet using code blocks to avoid loosed parts of your code. Thanks!
And again - anyway you need to have form element inside your modal and the modal shouldn't be inside external one form -
7. Re: a bug in modalPanel that <h:commandButton action won't t
vh Jun 5, 2007 4:56 PM (in response to vh)Here is goes again:
The files that with the modalPenal:<rich:modalPanel id="addDesktopMp" minHeight="280" minWidth="300" height="400" width="1000" zindex="2000"> <f:facet id="modalHeader" name="header"> <h:outputText id="modalTitle" value="#{bundle.AddDesktop}" /> </f:facet> <h:panelGroup id="wizard"> <a4j:include id="includeId" viewId="/pages/desktop/addDesktopType.xhtml" /> </h:panelGroup> </rich:modalPanel>
the wizard step: (pay attention to the finish button)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <h:form id="reviewForm" 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:rich="http://richfaces.ajax4jsf.org/rich"> <f:loadBundle basename="com.vmware.vdi.admin.ui.messages.MessageBundle" var="bundle"/> <a4j:keepAlive beanName="desktopBean" /> <table> <tr> <td align="left"> <h:outputText value="#{bundle.ReadyToComplete}"/> </td> </tr> <tr> <td align="left"> <h:outputText value="#{bundle.ReviewInstruction}"/> </td> </tr> <tr> <td> <rich:panel> <table> <tr> <td> <h:outputText value="#{bundle.DesktopTypeColon}" /> <h:outputText value="#{desktopBean.type}" /> </td> </tr> <tr> <td> <h:outputText value="#{bundle.DesktopIdColon}" /> <h:outputText value="#{desktopBean.id}" /> </td> </tr> <tr> <td> <h:outputText value="#{bundle.DesktopDisplayNameColon}" /> <h:outputText value="#{desktopBean.displayName}" /> </td> </tr> <tr> <td> <h:outputText value="#{bundle.VirtualCenterServerColon}" /> <h:outputText value="#{desktopBean.vcName}" /> </td> </tr> <tr> <td> <h:outputText value="#{bundle.VirtualMachineSelectionColon}" /> </td> </tr> <tr> <td> <rich:dataList value="#{desktopBean.selectedVMNames}" var="vm"> <h:outputText value="#{vm}"/> </rich:dataList> </td> </tr> </table> </rich:panel> </td> </tr> <tr> <td> <rich:spacer height="20px"> </rich:spacer> </td> </tr> <tr> <td align="center"> <a4j:commandButton action="back" value="#{bundle.Back}" reRender="wizard"/> <rich:spacer width="5px"></rich:spacer> <a4j:commandButton value="#{bundle.Finish}" action="#{desktopBean.addDesktop}" oncomplete="Richfaces.hideModalPanel('addDesktopMp');" reRender="wizard,myTable,treeTable"/> <rich:spacer width="5px"></rich:spacer> <a4j:commandButton action="cancel" actionListener="#{desktopBean.cancel}" value="#{bundle.Cancel}" oncomplete="Richfaces.hideModalPanel('addDesktopMp');" reRender="wizard"/> </td> </tr> </table> </h:form>
the bean method:
public String addDesktop() {
return "finish";
} -
8. Re: a bug in modalPanel that <h:commandButton action won't t
ilya_shaikovsky Jun 6, 2007 4:33 AM (in response to vh)Ok and I think the last question I missed to ask about your environment. I'll start to write the example for you now.