2 Replies Latest reply on Mar 10, 2008 11:05 AM by Stefan Schaf

    Using <s:link...> in HtmlDataTable

    Stefan Schaf Newbie


      I would like to create a dynamic dataTable view using a HtmlDataTable Object. I know how to do that for tables containing static text or attribute bindings like


      . Problem is, that I also want to have a

      entry in the first column. For Example:

      <h:dataTable id="users" value="#{users}" var="user">
         <f:facet name="header">Action</f:facet>
         <s:link id="editUser" value="Edit" action="#{userEdit.selectUser(user)}"/>
          <f:facet name="header">Login</f:facet>
        <f:facet name="header">Name</f:facet>

      What I already have worked out is this:

              dataTable = new HtmlDataTable();
              String[] cols = "login, name".split(",");
              // Set columns.
              for (int i = 0; i < columns; i++) {
                   String col = cols[i].trim();
                  // Set header (optional).
                  UIOutput header = new UIOutput();
                  // Set output.
                  UIOutput output = new UIOutput();
                  ValueBinding myItem = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{user." + col + "}");
                  output.setValueBinding("value", myItem);
                  // Set column.
                  UIColumn column = new UIColumn();
                  // Add column.

      This works fine, but now I need a way to include a seam link:


      How can I do this?

      Regards, MrBiggles