1 2 Previous Next 15 Replies Latest reply on Jan 29, 2008 12:10 PM by Arbi Sookazian

    working with a dynamically sized Datamodel with JSF/SEAM

    Arbi Sookazian Master

      using SEAM 1.2.1.GA and JBoss 4.0.5.GA.

      working with a callableStatement to a legacy stored proc in SQL SERVER db. need to know how to display the resultset data from the sproc in a JSF.
      the sproc builds the resultset based on the number of currently available user roles (which is unknown to the JSF before the DAO method is exec'd).

      Is it possible for the JSF xhtml to count the # of columns in the List that is returned (outjected) by the following code snippet and build the columns by referencing column numbers rather than names? I do not know the final list of column names until after the sproc is exec'd.

      Is there something similar to getColumnName(int columnNumber) method in the java.sql.ResultSet API? I didn't see one...

      Generally speaking, how are dynamic Datatables handled in Seam when you don't know the final column count?

      @DataModel
      List<SelectItem> myRoles = new ArrayList<SelectItem>();


      <h:dataTable var="myRole" value="#{myRoles}" rendered="#{userRoleSearch.displayViewRolesDataTable}">
       <h:column>
       <f:facet name="header">
       <h:outputText value="???"/>
       </f:facet>
       <h:outputText value="???"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="???"/>
       </f:facet>
       <h:outputText value="???"/>
       </h:column>
      </h:dataTable>


        1 2 Previous Next