0 Replies Latest reply on Jun 6, 2011 8:42 AM by Eduardo Crestani

    popupPanel doesnt open in a dynamic dataTable (richfaces 4)

    Eduardo Crestani Newbie

      Hi all,

       

      Im using richfaces 4.0.0.Final and i cant open the rich:popupPanel in a dynamic context (just right after the dataTable is render). Please check out my code, the problem is related to the first dataTable:

       

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

      <h:head>
      <title>Pesquisa simples</title>
      <link rel="stylesheet" href="../../css/cssPadrao.css" type="text/css" />

      </h:head>
      <h:body>
      <h:form id="formPesquisa">

        <a4j:status onstart="#{rich:component('statPane')}.show()"
         onstop="#{rich:component('statPane')}.hide()" />

        <rich:popupPanel id="statPane" autosized="true">
         <h:graphicImage value="/images/ico_loading_mini.gif" /> Carregando...    
         </rich:popupPanel>


        <h:inputText value="#{cadastroMasterMBean.voPadrao.nome}" id="nome"
         style="color: #003399; font-family: Tahoma, verdana; font-size: 11; width: 300px" />
        <br />

        <a4j:commandButton action="#{cadastroMasterMBean.executarPesquisaTeste}"
         value="Pesquisar" styleClass="botaoTop" style="margin-bottom: 5px"
         render="table1">
        </a4j:commandButton>

       

        <br />


       
      <!-- <a4j:outputPanel id="out" ajaxRendered="true">  -->

        <rich:dataTable id="table1" rows="10"
         value="#{cadastroMasterMBean.resultadoPesquisaTeste}"
         var="o"
         iterationStatusVar="it" styleClass="order-table"
         headerClass="order-table-header"
         rowClasses="order-table-odd-row,order-table-even-row">
        
      <f:facet name="noData">            
      Nothing found            
      </f:facet>

        <rich:column>
             <f:facet name="header">
                <h:commandLink action="#{order.sortByOrderNo}">
              Order No
                </h:commandLink>
             </f:facet>
             #{o.orderNo}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">
              Product Name
         </f:facet>
             #{o.productName}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">Price</f:facet>
             #{o.price}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">Quantity</f:facet>
             #{o.qty}
            </rich:column>

         <rich:column style="width:10px;" width="10">
        
                       <a4j:commandLink ajaxSingle="true" styleClass="no-decor" render="editPane" execute="@this"
                        style="text-decoration:center;margin-right: 5px"
                         oncomplete="#{rich:component('editPane')}.show()">                 
                            <h:graphicImage value="/images/edit.gif" style="border: 0px"/>                   
                             <a4j:param value="#{it.index}" assignTo="#{order.currentIndex}" />    
                               <f:setPropertyActionListener target="#{order.itemEditavel}" value="#{o}" />     
                         </a4j:commandLink>  
         </rich:column>
        

        </rich:dataTable>
      <!--   </a4j:outputPanel> -->

        <br/>
       
        <rich:dataTable id="table2" rows="10"
         value="#{order.orderList}"
         var="o"
         iterationStatusVar="it" styleClass="order-table"
         headerClass="order-table-header"
         rowClasses="order-table-odd-row,order-table-even-row">

       

            <rich:column>
             <f:facet name="header">
                <h:commandLink action="#{order.sortByOrderNo}">
              Order No
                </h:commandLink>
             </f:facet>
             #{o.orderNo}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">
              Product Name
         </f:facet>
             #{o.productName}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">Price</f:facet>
             #{o.price}
            </rich:column>

       

            <rich:column>
             <f:facet name="header">Quantity</f:facet>
             #{o.qty}
            </rich:column>

                        <rich:column style="width:10px;" width="10">
                                  
                        <a4j:commandLink styleClass="no-decor" render="editPane" execute="@this"
                        style="text-decoration:center;margin-right: 5px"
                         oncomplete="#{rich:component('editPane')}.show()">                 
                            <h:graphicImage value="/images/edit.gif" style="border: 0px"/>                   
                             <a4j:param value="#{it.index}" assignTo="#{order.currentIndex}" />    
                               <f:setPropertyActionListener target="#{order.itemEditavel}" value="#{o}" />     
                         </a4j:commandLink>            
                      
                       </rich:column>

               </rich:dataTable>


      <br/>

      <a4j:log/>


        <rich:popupPanel header="Editar" id="editPane" width="400" height="170">
         <a4j:commandButton value="Salvar"
          action="#{cadastroMasterMBean.salvar}" render="table"
          execute="editPane"
          oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('editPane')}.hide();}" />
         <a4j:commandButton value="Cancel"
          onclick="#{rich:component('editPane')}.hide(); return false;" />

        </rich:popupPanel>

       

      </h:form>
      </h:body>
      </html>