1 Reply Latest reply on Jan 13, 2010 3:46 AM by Ilya Shaikovsky

    <rich:modal Panel> Issue

    sorna sirahu Newbie

      Hi All...

      I have 2 command  buttons called save and cancel in <rich:modal Panel>

      I have a method for save validations in the backing bean. If i click save it works fine.

      Immediately after saving correctly if i try to save invalid message(debugging)  nothing happens!!!!! I mean the error messages not get displayed. But if i try again (after refreshing) the errror messages get displayed. What must be the problem?

       

      Please help me..

      code here:

       

       

      <rich:modalPanel id="changetimezoneModalPanel" autosized="true"  onshow="javascript:scroll(0, 0);focusElement('reqChangeTimezoneForm', 'requestFeatureModal_TypeId');"
           rendered="true" width="500" height="300" minWidth="400" minHeight="300">

      <rich:spacer id="changeTimeZoneEmptySpacer"/>

      <h:form id="reqChangeTimezoneForm">

      <table>

      <tr class="formLayoutTableRow">
                                                      <td class="formLayoutLabel"><h:outputLabel
                                                          value="Time Zone:" styleClass="labelStyle"
                                                          for="timezoneCreatetimezoneValue"
                                                          id="timezoneCreatetimezoneLabel" /></td>
                                                      <td class="formLayoutComponent"><a4j:outputPanel
                                                          ajaxRendered="true">
                                                          <h:selectOneMenu id="timezoneCreatetimezoneValue"
                                                              value="#{backing_timeZoneChangeModal.timeZoneId}">
                                                              <f:selectItem itemLabel="- Please Choose -" />
                                                              <f:selectItems
                                                                  value="#{backing_timeZoneChangeModal.timeZoneList}" />
                                                          </h:selectOneMenu>
                                                      </a4j:outputPanel></td>
                                                  </tr>

      <tr colspan=2>

      <td>

            <a4j:commandButton
                                                          action="#{backing_timeZoneChangeModal.save_action}"
                                                          styleClass="btnSave" id="SaveButton" oncomplete="#{rich:component(backing_timeZoneChangeModal.lovCloseValue)}.hide()"/>
                                                     
                                                      <a4j:commandButton action="#{backing_timeZoneChangeModal.cancel_action}"
                                                          styleClass="btnCancel" 
                                                          
                                                          oncomplete="#{rich:component('changetimezoneModalPanel')}.hide()"/></td></tr>

      </table>

      </h:form>

      </rich:modalPanel>

       

      This is my code snippet..

      lovCloseValue is a String in the backing bean that will ve the value either modal panel id or rich spacer id..

      If save_action succes it will have modal panel id(that is it must get hide if success) otherwise it will have the richspacer id to display error code