13 Replies Latest reply on Oct 7, 2011 6:12 AM by akaine

    rich:modalPanel and a4J:commandButton

    rohand

      I have following code

       

      <rich:modalPanel id="warning" width="300" height="180">

              <f:facet name="header">

                  <h:panelGroup>

                      <h:outputText value="Confirm"></h:outputText>

                  </h:panelGroup>

              </f:facet>

       

              <f:facet name="controls">

                  <h:panelGroup>

                      <h:graphicImage value="/images/close.png" styleClass="hidelink"

                          id="hideStagelink" />

                      <rich:componentControl for="deleteStageWarningDialog"

                          attachTo="hideStagelink" operation="hide" event="onclick" />

                  </h:panelGroup>

              </f:facet>

       

              <h:form id="deleteStageWarningDialogForm"

                  name="deleteStageWarningDialogForm">

                  <table width="300" border="0" cellpadding="0" cellspacing="0">

                      <tr>

                          <td height="100" valign="top">

                              <table width="100%" border="0" cellpadding="0" cellspacing="0">

                                  <tr>

                                      <td width="10%" valign="top">

                                          <!--DWLayoutEmptyCell--> </td>

                                      <td width="80%" height="100" valign="middle"><h:outputText

                                              value="Are you sure you want to delete?" /></td>

                                      <td width="10%" valign="top">

                                  </tr>

                              </table></td>

                      </tr>

                      <tr>

                          <td height="48" valign="top">

                              <table width="100%" border="0" cellpadding="0" cellspacing="0">

                                  <tr>

                                      <td width="150" height="48" align="right" valign="top">

                                      <a4j:commandButton id="deleteStageWarningButton" value="Yes" action="#{bean.deleteStage}" reRender="tabs"

                                                         oncomplete="#{rich:component('warning')}.hide();#{rich:component('panelStage')}.hide();"  style="width:75px; margin-right:5px;" /></td>

                                      <td width="150" align="left" valign="top"><a4j:commandButton

                                              id="cancelStageWarningButton" value="No"

                                              onclick="#{rich:component('warning')}.hide();return false;"

                                              style="width:75px; margin-left:5px;" /></td>

                                  </tr>

                              </table></td>

                      </tr>

                  </table>

              </h:form>

          </rich:modalPanel>

       

      When I click Yes the application just crashes.

      Can anyone help me with this?

      Thanks

        • 1. Re: rich:modalPanel ann a4J:commandButton
          akaine

          Most probable cause is the code in bean.deleteStage. Also, what do you call a "crush"?

          • 2. Re: rich:modalPanel ann a4J:commandButton
            rohand

            Hi Akaine,

             

            I have already checked using breakpoints.. the control is not even going to the bean. Dont know what us causing that.

             

            --RD

            • 3. Re: rich:modalPanel ann a4J:commandButton
              akaine

              What happens exactly when you hit the button?

               

              What happens if you replace h:form with a4j:form?

               

              Do you have your modal window inside another form?

              • 4. Re: rich:modalPanel ann a4J:commandButton
                rohand

                When I hit the Yes Button my application just crashes and i get blank screen. My modal panel is not inside any form.

                I am getting same behavior with a4j form too !

                • 5. Re: rich:modalPanel ann a4J:commandButton
                  akaine

                  Man, do you have the stacktrace of the exception occuring?

                  • 6. Re: rich:modalPanel ann a4J:commandButton
                    rohand

                    No exception no error on console..

                    • 7. Re: rich:modalPanel ann a4J:commandButton
                      akaine

                      Blank screen is a typical behavior of Internet Explorer to error 500. Try running this in Firefox or Chrome. As for the stacktrace it SHOULD exist unless it's being caught without error output on purpose, or you do not have console integration with your server. What IDE, App Server do you use?

                       

                      Also I would recommend installing Firebug plugin to Firefox to see what's RF's javascript is doing in the process.

                      • 8. Re: rich:modalPanel ann a4J:commandButton
                        rohand

                        It is happening in all the browsers. I dont think there is any javascript error. We use eclipse. Webservices run in Jboss-eap 5.1 and portal runs in Liferay tomcat 6. If there is any javascript error i guess IE would show that in the bottom (done with errors) there isnt any.

                         

                        I just cant figure out whats wrong with code above.

                        • 9. Re: rich:modalPanel ann a4J:commandButton
                          akaine

                          My apologies but I'm out of ideas. Sorry, couldn't be of much help .

                           

                          If it's even possible in your case try to revert to JSF1.2, these kinds of problems are the exact reason I'm still using RF3 and JSF1.2.

                          • 10. Re: rich:modalPanel ann a4J:commandButton
                            rohand

                            I am using JSF 1.2 and RF 3.3.3. Unfortuanately all the modal panels in portal have some kind of weird problems.

                             

                            Thanks a lot for ur time and help.

                             

                            Cheers

                            --RD

                            • 11. Re: rich:modalPanel ann a4J:commandButton
                              akaine

                              Sorry, thought you've been using JSF2.

                               

                              If you tell that this happens globally this can be related to the RF config in web.xml, the most stable would be using the default xml parser means you should have only skinning declarations, a4j filter and its mapping, with no xmlparser configs, something like this:

                               

                              <!-- RichFaces ================================================================================ -->
                              
                                  <context-param>
                                      <param-name>org.richfaces.SKIN</param-name>
                                      <param-value>laguna</param-value>
                                  </context-param>
                                  <context-param>
                                      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                                      <param-value>enable</param-value>
                                  </context-param>
                              
                                  <filter>
                                      <display-name>Ajax4jsf Filter</display-name>
                                      <filter-name>ajax4jsf</filter-name>
                                      <filter-class>org.ajax4jsf.Filter</filter-class>
                                  </filter>
                              
                                  <filter-mapping>
                                      <filter-name>ajax4jsf</filter-name>
                                      <servlet-name>Faces Servlet</servlet-name>
                                      <dispatcher>REQUEST</dispatcher>
                                      <dispatcher>FORWARD</dispatcher>
                                      <dispatcher>INCLUDE</dispatcher>
                                  </filter-mapping>
                              

                               

                              Also, in JSF1.2 it's a good practice to always declare all backing beans used in the view with <a4j:keepAlive beanName="myBackingBean"/>

                              • 12. Re: rich:modalPanel ann a4J:commandButton
                                rohand

                                Yes I am using default xmlparser configurations and all the mappings as mentioned above.

                                 

                                Cheers

                                • 13. Re: rich:modalPanel ann a4J:commandButton
                                  akaine

                                  Considering the facts I would begin concept tests, what's failing and what's not. Try the functionality of basic elements, combos, simple modals, action calls; slightly complicating things as you proceed, etc. to determine the problem.

                                   

                                  Also I've seen RF behaving badly on some app servers like WAS and WL since they have their own implementations of JSF.

                                   

                                  Be sure you are loading "your" JSF jars and not the server's. In WAS change class loading strategy and add JSF as common libs.

                                   

                                  Well... that's all I can do with the little info I have here. Sorry if nothing helped.