0 Replies Latest reply on Feb 17, 2009 2:26 AM by Naresh Bhatia

    ModalPanel to edit row in DataTable

    Naresh Bhatia Newbie

      I need to open up a RichFaces modal panel to edit a row in a dataTable. The dataTable has a link on every row called Edit. When this link is pressed I need to open the model panel, passing it the entity to be edited. Can someone suggest where I should start? My controller uses a @DataModelSelection to figure out which row was selected. Would that help in this case?


      <h:form>
          <h:dataTable id="userAccounts" value="#{userAccounts}" var="account">
              <h:column id="accountName">
                  <f:facet name="header" id="nameFacet">Name</f:facet>
                  <h:commandLink value="#{account.name}" action="#{accountListController.select}"/>
              </h:column>
              <h:column id="accountNumber">
                  <f:facet name="header" id="ccountNumberFacet">Account Number}</f:facet>
                  <h:commandLink value="#{account.id}" action="#{accountListController.select}"/>
              </h:column>
              <h:column id="value">
                  <f:facet name="header" id="valueFacet">Value</f:facet>
                  <h:outputText value="#{account.value}" />
              </h:column>
              <h:column id="actions">
                  <f:facet name="header" id="actionFacet">Actions</f:facet>
                  <h:commandLink value="Edit" action="#"/>
              </h:column>
          </h:dataTable>
      </h:form>
      



      Thanks.


      Naresh