2

I have a DataModel which contains IRoomDomain objects. Every IRoomDomain object has an IOccupancy array.

I want to use a data table to display them. Since every IRoomDomain can have several IOccupancy, I want to have a rowspan over the IRoomDomain IDs:

Var is room

 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 column room ID, 1 column occupancy data), but it displays the header for every room, not once above as I want it to.

In addition, this construct must be selectable for the Room ID.

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

Thanks in advance.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
jcklie
  • 4,054
  • 3
  • 24
  • 42

1 Answers1

0

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

Pino
  • 7,468
  • 6
  • 50
  • 69
Leonel Sanches da Silva
  • 6,972
  • 9
  • 46
  • 66