4 Replies Latest reply on Jul 29, 2010 2:05 AM by moulali

    h:commandButton does not show animation in the modalpanel

    moulali

      Hi,

       

      I have two buttons - OK and Cancel. Clicking on OK shold open a modelpanel with an animated image( page loading...).

       

      If I use h:commandButton, modalpanel appers without animation and loads next page.

       

      If I use a4j:commandButton, modalpanel appears with animation and gives me javascript object error, without loading new page.

       

      How to rectify this?

       

      Thanks in advance,

        • 1. Re: h:commandButton does not show animation in the modalpanel
          ilya_shaikovsky

          in order to make navigation working with ajax controls - you should use redirect rules for navigation.

          • 2. Re: h:commandButton does not show animation in the modalpanel
            moulali

            This is my code. Can U brief it, please?

             

            This code gives a modalPanel without animation(spinner.gif) and redirects to a new page.

             

            How to make it animated and redirect to a new page.

            .........

             

            <h:commandButton id = "legalId" value="Ok" action="#{entityViewerBean.getHomePage}"
                            onclick = "Richfaces.showModalPanel('ajaxLoadingModalBox')"   style = "width:55px"  styleClass="lgn_button">     
            </h:commandButton>

             

            ..........

             

            <rich:modalPanel id="ajaxLoadingModalBox" minHeight="125" minWidth="250"
                        height="75" width="250" zindex="2000" style="background-color: #FFFFFF; width: 100%; border-width: 1px; border-color: black; border-style: solid; text-align: center;">
                        <f:facet name="header">
                              <h:outputText value="Processing your request ...." styleClass="dataValueHeaderStyle"/>
                        </f:facet>
                        <h:panelGrid columns="1" style="width: 100%; border-width: 0px; text-align: center;">
                              <h:outputText value="Please wait..." styleClass="dataValueStyle"/>
                              <h:graphicImage value="/images/spinner.gif"/>
                        </h:panelGrid>
                  </rich:modalPanel>

             

             

            Thanks,

            • 3. Re: h:commandButton does not show animation in the modalpanel
              ilya_shaikovsky

              try a4j:commandButton but in that case navigation case which returned by entityViewerBean.getHomePage outcome should be defined as redirect.

              • 4. Re: h:commandButton does not show animation in the modalpanel
                moulali

                Thanks, it worked. Here is the code I added.

                 

                <navigation-case>
                             <from-outcome>home</from-outcome>
                             <to-view-id>/pages/nowhome.jsp</to-view-id>
                          <redirect/>
                </navigation-case>

                 

                But, validations are suppressed by using redirect. How to solve this?

                 

                I definitely appreciate Ur support.

                 

                Thanks,