1 Reply Latest reply on Jan 20, 2011 10:30 AM by ilya40umov

    a question about commandButton...

    ivanjsm

      I'm wondering if it is possible to configure the 'SAVE' button on the modalPanel in the way like this:

      • if the result of the function calling(action="#{UsersDataController.doCreateAccount}") is false - the modalPanel should not close. And on the modalPanel should be outputted the result of the function calling;
      • if the result of the function calling(action="#{UsersDataController.doCreateAccount}") is true - the modalPanel should be closed automatically.

      So is it possible?

       

      As for now the modalPanel closes anyway(

       

      i have a modalPanel and such button:

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j">
          <rich:modalPanel id="add_newuser_modal_panel" autosized="true" width="200" >
              <f:facet name="header">
                  <h:outputText value="Adding a new user"
                                style="padding-right:20px;" />
              </f:facet>
              <h:form>
                  <h:panelGrid columns="2" cellspacing="2px" >
      
       ...
      
                  </h:panelGrid>
       <a4j:commandButton value="  Yes  "
       oncomplete="#{rich:component('add_newuser_modal_panel')}.hide();"
       action="#{UsersDataController.doCreateAccount}"
       id="modal_new_confirm_button" />
              </h:form>
          </rich:modalPanel>
      </ui:composition>
      
      

       

       

      Please, help.

      Thanks.