Nested Data Tables

I have a DataModel that contains IRoomDomain objects. Each IRoomDomain object has an IOccupancy array.

I want to use a data table to display them. Since each IRoomDomain can have several IOccupancy, I want to have rows by IRoomDomain IDs:

Var is the number

Room ID| Label field 1 | Label field 2 | ... -------|----------------------------|----------------------------|------ //Room1| room.occupancies[0].field1 | room.occupancies[1].field2 | ... room.ID| room.occupancies[1].field1 | room.occupancies[1].field1 | ... | room.occupancies[2].field1 | room.occupancies[3].field1 | ... --------|----------------------------|----------------------------|------ //Room2| room.occupancies[0].field1 | room.occupancies[1].field2 | ... room.ID| room.occupancies[1].field1 | room.occupancies[1].field1 | ... | room.occupancies[2].field1 | room.occupancies[3].field1 | ... --------|----------------------------|----------------------------|------ 

I tried a nested data table (1 well room identifier, column fill data), but it displays a heading for each room, and not once higher as I want.

In addition, this design must be selected for the room identifier.

Is there any way to implement this with JSF / PrimeFaces? The data model can be changed, but the relation is not fulfilled.

Thanks in advance.

+2
source share
1 answer

Yes, using PanelGrid. PrimeFaces DataTable is not flexible enough to implement this level of nesting. Check this:

https://www.primefaces.org/showcase/ui/panel/panelGrid.xhtml

0
source

All Articles