June 2014
Intermediate to advanced
578 pages
12h 2m
English
It's most likely that you won't need to display a table inside another table, but there are cases when this workaround can be useful in obtaining a clear presentation of the data. For example, nested collections can be presented as nested tables as follows:
HashMap<Players, HashSet<Trophies>> dataHashMap = new HashMap<>();
Here, players are stored in HashMap as keys, and each player has a collection (HashSet) of trophies. Each HashSet value is a value in HashMap. Therefore, you need to display the table of players; however, you need to display each player's trophies. This can be achieved as shown in the following code:
<h:dataTable value="#{playersBean.dataHashMap.entrySet()}" var="t"> <h:column> <f:facet name="header">Ranking</f:facet> ...Read now
Unlock full access