Landister
Landister

Reputation: 2224

Collapsible Panels in jsf/primefaces

So what I want is this (Just the collapsible part):

http://www.primefaces.org/showcase-labs/ui/layoutEvents.jsf;jsessionid=238C388CE45C77A9B90898A82F2340EA

With 2 differences.

  1. I want it in a datatable

  2. I want to make a custom button that will control whether or not they are collapsed

Is this possible if so is there a good example I can go off?

Upvotes: 0

Views: 5978

Answers (1)

phanneman
phanneman

Reputation: 436

i would start by

  • creating the dataTable as you want it to look with the row fully 'expanded'
  • put the data to be toggled in a panelGroup
  • put some sort of toggle on the row
  • put an effect on the panelGroup
  • put an action on your toggle to show/hide the panelGroup for the row

Some component libraries have this. they call them 'expandible rows', some display the data in the row, some render the row(s) below the 'parent' one.

One issue that i found (in earlier versions) is that when you had the data display in a separate row and you had a paginator set to show a set rows to display, it would bump the last row(s) when expanding the requested row to expand. I don't know if that is still the case.

Upvotes: 1

Related Questions