3 Replies Latest reply on Aug 10, 2010 3:38 AM by Myriam Ferreiro

    Problem with rich:modalPanel

    Myriam Ferreiro Newbie

      Hi all!,

       

      I have a problem that I don´t manage to solve ... so any help will be welcome!

       

      In my application I need to show a modal panel in which I can consult information. The problem is that I open the modal panel and does not do anything; I try to do some consultation but in my bean the information of filter that I have informed does not exist (the attributes of the bean always are null).

       

      The invocation to the modal panel (to try I have made a .jsp that only has a button):

       

         <a4j:include  viewId="../helpers/helperAgentes.jsp"/>
       
         <a4j:commandButton value="Abrir pop up" type="button" oncomplete="#{rich:component('confirmacion')}.show()" styleClass="boton"    style="cursor:hand" />

       

       

      My modal panel is in an individual .jsp because I need to use it in the whole application:

       

       

      <body>

       

      <rich:modalPanel id="confirmacion" left="100" top="100"  height="465" width="850" rendered="true">
        
      <rich:panel id="busqueda" header="Búsqueda" style="width: 830px; height:150px;" rendered="true">

       

      <table id="filtros" border="0" cellpadding="0" cellspacing="0" width="70%">

       

      .... Filters of the query ....

       

      </table>
      <br>
      <a4j:commandButton type="button" id="btnConsultar" value="Consultar" action="#{helperAgentes.consultarAgente}" styleClass="boton" style="cursor:hand" reRender="idTablaConsulta,tabla"/>
      </rich:panel>

       

      <rich:simpleTogglePanel switchType="client" label="Listado" id="idTablaConsulta" width="830px" >

       

      <rich:extendedDataTable
                      value="#{helperAgentes.tablaConsulta}"
                      var="agente" id="tabla"
                      width = "798px" height="200px"
                      sortMode="single"
                      selectionMode="single"
                      selection="#{helperAgentes.selection}"
                      style="width: 1129px">
                     
                      ...  results ....
                     
      </rich:extendedDataTable>               

       

      </rich:simpleTogglePanel>
      <br>
      <a4j:commandButton id="btnCerrar" value="Cerrar" onclick="javascript:Richfaces.hideModalPanel('confirmacion');" styleClass="boton" style="cursor:hand"/>
      </rich:modalPanel>
      </body>

        • 1. Re: Problem with rich:modalPanel
          liumin hu Master

          hi,

           

          i dont see a form in your modalpanel.

          • 2. Re: Problem with rich:modalPanel
            Siva P Master
            Change your code like this,
            1) In your case you have to add the below code after </h:form> ends,according to your model panel path and page specifiy the url.you have to add this in the Main jsp page.
            <html>
            <body>
            <h:form>
            </h:form>
            <c:import url="../sample/individual .jsp" />
            </body>
            </html>

            2)Change your <a4j:commandButton like below, you have to reRender the modelpanel id.
            <a4j:commandButton value="Abrir pop up" type="button" reRender="processingSubview" oncomplete="#{rich:component('confirmacion')}.show()" styleClass="boton"    style="cursor:hand" />
            3) Change your jsp as like this format
            <f:subview id="processingTransModalSubview">
            your individual .jsp details
            </f:subview>
            for exmple:(individual .jsp)
            <f:subview id="processingSubview">
                 <a4j:status for="transactionRegion" onstart="#{rich:component('waitTrans')}.show()"
                    onstop="#{rich:component('waitTrans')}.hide()"  />
                <rich:modalPanel id="waitTrans" autosized="true"  styleClass="transactionProcessingModal" width="300" height="50" moveable="false" resizeable="false">
                    <f:facet name="header">
                        <h:outputText value="Processing" styleClass="modalPanel12" />
                    </f:facet>
                    <h:outputText value="Data Processing" styleClass="celcomBlack01" />
                </rich:modalPanel>
                </f:subview>
               You can.....
            1 of 1 people found this helpful
            • 3. Re: Problem with rich:modalPanel
              Myriam Ferreiro Newbie

              I've found the solution combining your two answers. I don´t know why but it works (i'm still learning).

               

              In my principal jsp a put the import of the individual jsp, just like sivaprasad said:

               

              <a4j:form id="formulario">
                
                 <a4j:include  viewId="../helpers/helperAgentes.jsp" />
               
                 <a4j:commandButton reRender="confirmacion,form" value="Abrir pop up" type="button" oncomplete="#{rich:component('confirmacion')}.show()" styleClass="boton" style="cursor:hand" />                       

               

              </a4j:form>
              <c:import  url="../helpers/helperAgentes.jsp" />

               

              And in my individual jsp I put the form just like liumin said.

               

              <rich:modalPanel id="confirmacion" left="100" top="100"  height="465" width="850" rendered="true">

               

              <h:form id="form">

               

              ..........

               

              </h:form>
              </rich:modalPanel>

               

              Thank you so much!