4 Replies Latest reply on Apr 7, 2011 10:25 AM by ezikoh

    ¿How return value of row a table from modalPanel?

    ezikoh

      Hi

       

      Hello, my problem is how return the values of row when is selected a row in a table using a ModalPanel. The objective is actualize a outputtext in a panel with the data selected in a table inside in modal Panel.

       

      Thank You

        • 1. ¿How return value of row a table from modalPanel?
          lfryc

          Hi,

           

          it seems you are trying to implement the sample from RichFaces Showcase, you can check out sources there:

           

          http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=dataTable&sample=dataTableEdit&skin=blueSky

          • 2. ¿How return value of row a table from modalPanel?
            ezikoh

            Than you lucas, but I need somethig more easy, by example, I can rerender an outputtext in form from a modaPanel?

            • 3. Re: ¿How return value of row a table from modalPanel?
              lfryc

              You will first need to store the "selected" model item, there is link which will be in each row:

               

              <a4j:commandLink value="Edit" render="editGrid"
                                  execute="@this" oncomplete="#{rich:component('editPane')}.show()">
                                  <a4j:param value="#{it.index}"
                                      assignTo="#{carsBean.currentCarIndex}" />
              </a4j:commandLink>
              
              

               

              Then you need to define popupPanel in modal mode:

               

               

              <rich:popupPanel header="Edit Car Details" id="editPane" domElementAttachment="parent" width="400" height="170">
              
              
                          <h:panelGrid columns="3" id="editGrid">
                              ...
                              <h:inputText value="#{carsBean.editedCar.price}" />
                              ...
              
                          <a4j:commandButton value="Store" action="#{carsBean.store}"
                              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>
              
              
              • 4. ¿How return value of row a table from modalPanel?
                ezikoh

                Very good!!! Lukas, Thank you for the solution.