1 Reply Latest reply on Aug 20, 2009 10:03 PM by asookazian

    DataTable and modalPanel

    ypasmk

      A snippet of my productHandler bean




      @DataModel
      private List<Products> listProduct;
      
      @DataModelSelection("listProduct")
      private Product selectedProduct;
      
      



      a snippet of my xhtml page




      <rich:dataTable value="listProduct" var="list">
      <f:facet name="header">
                                    <rich:columnGroup>
                                              <h:column>
                                                   <h:outputText value="#{messages.serial}" />
                                              </h:column>
                                              <h:column>
                                                   <h:outputText value="#{messages.productname}" />
                                              </h:column>
                                              <h:column>
                                                   <h:outputText value="#{messages.productdescription}" />
                                              </h:column>
                                              <h:column>
                                                   <h:outputText value="#{messages.productprice}" />
                                              </h:column>
                                              <h:column>
                                                   <h:outputText value="#{messages.productquantity}" />
                                              </h:column>
                                              <h:column>
                                                   <h:outputText value="#{messages.productcategory}" />
                                              </h:column>          
                                              </rich:columnGroup>                    
                                    </f:facet>
                                    <h:column>
                                         <h:outputText value="#{list.serial}" />
                                    </h:column>
                                    <h:column>
                                         <h:outputText value="#{list.name}" />
                                    </h:column>
                                    <h:column>
                                         <h:outputText value="#{list.description}" />
                                    </h:column>
                                    <h:column>
                                         <h:outputText value="#{list.price}" />
                                    </h:column>
                                    <h:column>
                                         <h:outputText value="#{list.quantity}" />
                                    </h:column>
                                    <h:column>
                                         <rich:dataTable id="listproducts1" rows="50" columnClasses="col"
                                    value="#{list.categories}" var="listcats">
                                         <h:column><h:outputText value="#{listcats.name}"/></h:column>
                                         </rich:dataTable>
                                         
                                    <a4j:commandLink value="#" id="link" action="#{productHandler.showSelected1}"
                                    oncomplete="Richfaces.showModalPanel('panel');">
              Delete
              
          </a4j:commandLink>
                                    </h:column>
                
      
      </rich:DataTable>
      
        <rich:modalPanel id="panel" width="350" height="100">
              <f:facet name="header">
                  <h:panelGroup>
                      <h:outputText value="Modal Panel"></h:outputText>
                  </h:panelGroup>
              </f:facet>
              <f:facet name="controls">
                  <h:panelGroup>
                      <h:outputText value="test" styleClass="hidelink" id="hidelink"/>
                      <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
                  </h:panelGroup>
              </f:facet>
              <h:outputText value="#{messages.productname} : #{selectedProduct.name}"/><br/>
              <h:outputText value="#{messages.deleteproductconfirmation}"/>
              <a4j:commandButton value="Yes" onclick="RichFaces:component('panel')}.hide()"/> <a4j:commandButton value="No" onclick="rich:component('panel')}.hide()"/> 
          </rich:modalPanel>
      




      in the modalPanel the product name is always empty...why is that?how can I display the selected product in the modalpanel?

        • 1. Re: DataTable and modalPanel
          asookazian

          You need to reRender the modalPanel here:


          <a4j:commandLink value="#" id="link" action="#{productHandler.showSelected1}"
                                    oncomplete="Richfaces.showModalPanel('panel');"
                                                reRender="panel">