6 Replies Latest reply on Oct 15, 2008 6:30 AM by Jaseem Ambalangadan

    How to iterate an ArrayList in a dataTable or an ArrayList in a Bean

    Jaseem Ambalangadan Newbie
      MY BEAN CONTAINS THE FOLLOWING

      private String objectName = null;
      @Transient
      private ArrayList listObjectPermissions = null;

      @NotNull
      public String getObjectName() {
        return objectName;
      }
      public void setObjectName(String objectName) {
        this.objectName = objectName;

      public ArrayList getListObjectPermissions() {
          return listObjectPermissions;
      }
      public void setListObjectPermissions(ArrayList listObjectPermissions) {
         this.listObjectPermissions = listObjectPermissions;
      }

      MY ACTION FILE CONTAINS
      @DataModel
      private List<ObjectsBean> menus;
      @DataModelSelectionIndex("menus")
      private int menuIndex;
      public void addGroup() {
        GroupBO groupBO = null;
        groupBO = new GroupBO();
        menus = groupBO.listObjects(em);
      }

      MY JSF PAGE CONTAINS THE FOLLOWING

      <h:dataTable value="#{menus}" var="objects" class="gridTab">
        <h:column>
           <f:facet name="header">Object Name</f:facet>
           <h:outputLabel value="#{objects.objectName}" />
        </h:column>
        <h:column>
           <f:facet name="header">Object Name</f:facet>
           <h:outputLabel value="#{objects.listObjectPermissions}" />
        </h:column>
      </h:dataTable>

      I need to iterate the value of #(objects.listObjectPermissions)
      Since it is the ArrayList inside the dataTable I am not in a position to iterate it. Pleas help me.