Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

showing a List of Maps in a dataTable

843842Aug 9 2006 — edited Aug 9 2006
Hi all,
How can we show a List of Maps in a DataTable in JSF? (Rows iterate on List and columns iterate on Maps index. like a table with dynamic header and values.)

Verbose Question:
I am new to JSF and developing a search application using it. I've got a search.jsp page which a user can type his query in it and also choose his results format from some checkboxes whithin this page.
I've got a Document class which has got different attributes of a document like its name, ceator, etc . result format contains some attributes of a Document which the user wants to see in the results page.
when the search is done via a search API i fill a List of a Map as the search result and pass it to my result.jsp page. a List 'cause number of founded documents can be more thn one and a Map 'cause user can choose different attributes of a Document to e shown and this map is of pairs of <attributeName, attributeValue> (e.g. <"creator", "Alex">)
Now I want to show this List of Maps in my Result.jsp page so that the header of my dataTable tekes its values from the Map index(first element of each pair) and each row represent a document.
(e.g. the results table:
creator docName path
------------------------------------------------
Alex test.txt c:/temp/test.txt
--------------------------------------------------
Ach new.doc c:/new.doc
)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2006
Added on Aug 9 2006
2 comments
38 views