1 Reply Latest reply on Aug 27, 2010 10:14 AM by Siva P

    Trouble with validation in ModalPanels

    Dominic Warzok Newbie

      Hi together,

       

      I have some trouble with my ModalPanels.

       

      They didn't close if I press the Save Button and all things are ok. Or they close always so that the validation error is ignored and you see it only if you open the panel again.

       

      Maybe someone of you have an idea how to fix this.

       

      Here is the code of my panel

       

      <rich:modalPanel id="publisherPanel" width="300" height="200">

       

      <s:div id="publisherPanelOuterDiv">

       

      <h:form id="publisherPanelForm">

       

      <h:panelGrid columns="1">

       

      <s:decorate template="/layout/edit.xhtml">
      <ui:define name="label">Name:</ui:define>
      <h:inputText id="name" value="#{publisherHome.instance.name}"
      required="true"  />
      </s:decorate>

       

      </h:panelGrid>

       

      <a:commandButton value="Save"
      action="#{publisherHome.persistAndClear}"
      reRender="publisherFieldListMenu, publisherPanelOuterDiv"
      oncomplete="if(name == true) Richfaces.hideModalPanel('publisherPanel') " />

       

      </h:form>

       

      <a:commandButton value="Cancel"
      onclick="Richfaces.hideModalPanel('publisherPanel')"
      rendered="#{publisherHome.panelActive}" /

       

      <h:messages globalOnly="true"
      styleClass="message" errorClass="errormsg" infoClass="infomsg"
      warnClass="warnmsg" rendered="#{showGlobalMessages != 'false'}" />

       

      </s:div>

       

      </rich:modalPanel>

       

      thanks in advance

      Dominic

       

      PS: Sry for my bad english but I don't use it often