This content has been marked as final.
Show 6 replies
-
1. Re: How to: validate before clicking action to close modal d
sergeysmirnov Oct 3, 2007 11:40 AM (in response to lbbishop)what do you have now? What your action method returns?
-
2. Re: How to: validate before clicking action to close modal d
lbbishop Oct 3, 2007 12:18 PM (in response to lbbishop)If I click Update Type button, updateTypeAction is called. Is there a way to not hide the modal panel if a updateTypeAction returns "failure".
<!-- ==================== modal panel ====================== --> <rich:modalPanel id="travelerTypePanel" width="700" height="240"> <f:facet name="header"> <h:outputText value="Traveler Type Definition" /> </f:facet> <f:facet name="controls"> <h:form> <a4j:commandLink action="#{projectAdminView.clearTypeAction}" onclick="javascript:Richfaces.hideModalPanel('travelerTypePanel')"> <h:outputText value="X" styleClass="panelControl" /> </a4j:commandLink> </h:form> </f:facet> <h:panelGrid columns="1"> <h:form> <a4j:outputPanel ajaxRendered="true"> <h:panelGrid columns="1"> <t:messages showSummary="false" showDetail="true" summaryFormat="{0}:" errorClass="errors" infoClass="info" /> </h:panelGrid> </a4j:outputPanel> <a4j:outputPanel ajaxRendered="true"> <h:panelGrid columns="2"> <h:outputText value="Type Name:" styleClass="label-bold" /> <h:panelGroup> <h:inputText id="typeName" value="#{projectAdminView.typeName}" disabled="#{projectAdminView.typeInUse}" size="20" maxlength="20"> <a4j:support event="onchange" action="#{projectAdminView.checkTypeName}" /> </h:inputText> </h:panelGroup> <h:outputText value="Type Description:" styleClass="label-bold" /> <h:panelGroup> <h:inputText id="typeDescription" value="#{projectAdminView.typeDescription}" size="80" maxlength="128" /> </h:panelGroup> </h:panelGrid> <h:panelGrid columns="1"> <h:panelGroup> <a4j:commandButton value="Add Type" action="#{projectAdminView.addTypeAction}" styleClass="button-default" rendered="#{projectAdminView.addTypeButtonRendered}" /> <a4j:commandButton value="Update Type" action="#{projectAdminView.updateTypeAction}" styleClass="button-default" rendered="#{not projectAdminView.addTypeButtonRendered}"/> <a4j:commandButton value="#{label.clearButton}" action="#{projectAdminView.clearTypeAction}" styleClass="button-default" rendered="#{not projectAdminView.typeInUse}"/> </h:panelGroup> </h:panelGrid> </a4j:outputPanel> <h:panelGrid columns="1"> <a4j:commandLink action="#{projectAdminView.clearTypeAction}" onclick="javascript:Richfaces.hideModalPanel('travelerTypePanel')"> <h:outputText value="Close" styleClass="link-large" /> </a4j:commandLink> </h:panelGrid> </h:form> </h:panelGrid> </rich:modalPanel>
-
3. Re: How to: validate before clicking action to close modal d
lbbishop Oct 3, 2007 12:21 PM (in response to lbbishop)Here is the correct code (without close button and onclick on update button).
<!-- ==================== modal panel ====================== --> <rich:modalPanel id="travelerTypePanel" width="700" height="240"> <f:facet name="header"> <h:outputText value="Traveler Type Definition" /> </f:facet> <f:facet name="controls"> <h:form> <a4j:commandLink action="#{projectAdminView.clearTypeAction}" onclick="javascript:Richfaces.hideModalPanel('travelerTypePanel')"> <h:outputText value="X" styleClass="panelControl" /> </a4j:commandLink> </h:form> </f:facet> <h:panelGrid columns="1"> <h:form> <a4j:outputPanel ajaxRendered="true"> <h:panelGrid columns="1"> <t:messages showSummary="false" showDetail="true" summaryFormat="{0}:" errorClass="errors" infoClass="info" /> </h:panelGrid> </a4j:outputPanel> <a4j:outputPanel ajaxRendered="true"> <h:panelGrid columns="2"> <h:outputText value="Type Name:" styleClass="label-bold" /> <h:panelGroup> <h:inputText id="typeName" value="#{projectAdminView.typeName}" disabled="#{projectAdminView.typeInUse}" size="20" maxlength="20"> <a4j:support event="onchange" action="#{projectAdminView.checkTypeName}" /> </h:inputText> </h:panelGroup> <h:outputText value="Type Description:" styleClass="label-bold" /> <h:panelGroup> <h:inputText id="typeDescription" value="#{projectAdminView.typeDescription}" size="80" maxlength="128" /> </h:panelGroup> </h:panelGrid> <h:panelGrid columns="1"> <h:panelGroup> <a4j:commandButton value="Update Type" action="#{projectAdminView.updateTypeAction}" styleClass="button-default" rendered="#{not projectAdminView.addTypeButtonRendered}" onclick="javascript:Richfaces.hideModalPanel('travelerTypePanel')"/> </h:panelGroup> </h:panelGrid> </a4j:outputPanel> </h:form> </h:panelGrid> </rich:modalPanel>
-
4. Re: How to: validate before clicking action to close modal d
sergeysmirnov Oct 3, 2007 1:49 PM (in response to lbbishop)The second question is still important. Are you going to proceed to another page is validation is ok or you want to stay on the same page after the dialog is closed.
-
5. Re: How to: validate before clicking action to close modal d
sarats Oct 8, 2008 4:19 PM (in response to lbbishop)Was there ever a solution to this?
I too want to leave my modal open if the seam validation fails.
I am posting button code here:<a:commandButton value="Save Changes" reRender="infoPanel"
action="#{processingManager.saveAddress}" oncomplete="javascript:Richfaces.hideModalPanel('editPanel')"/>
When the user clicks this button the modal is closed even if the validation fails. I want the modal to stay open.
Any help is greatly appreciated.
Thanks! -
6. Re: How to: validate before clicking action to close modal d
sarats Oct 8, 2008 4:29 PM (in response to lbbishop)Ok, nevermind. A little more hunting produced this:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112911&start=-10&postdays=postDays&postorder=postOrder&highlight=highlight