3 Replies Latest reply on Jul 2, 2010 4:49 AM by Nick Belaevski

    Iterate through List of List of Objects in DataTable or ExtendedDataTable

    Satya K Newbie

      Hello All,

       

      I have a "ArrayList of ArrayList of Objects" and would like to build a Table by iterating through the list.

       

      Ex: List<ArrayList<ColumnObject>> list = ArrayList<ArrayList<ColumnObject>>();

       

           The ColumnObject has name and value properties. So iterating through inner List means, each ColumnObject is a column in the table and

       

           each "inner ArrayList" becomes a row of the table. Then number of rows of the table = " size of the outermost ArrayList"

       

           List<ArrayList<ColumnObject>> = List<RowObjects>

       

      I earlier had similar requirement in building ExtendedDataTable, tried all possibilities with nested <c:forEach>, didnt succeed.

       

      Ultimately I had to create a RowObject by iterating over inner ArrayList<ColumnObject> i.e read ColumnObject data and build a RowObject. Then pass

       

      the list of RowObjects to ExtendedDataTable which would automatically takes care of.

       

      Can anybody please let me know how to build the table with this kind of data model.

       

      Please post some sample code if possible.

       

      Regards,
      Satya