Saturday, January 17, 2009

Panel Collection and Hidden Columns

In 11g, I like af:panelCollection (Panel Collection) component. I like it, because I can surround af:table component with Panel Collection and get additional functionality for free. For example, often there is a requirement not to show specific columns by default, however allow user to select them later. In 10g, there was no standard way to do this, in 11g it comes with Panel Collection functionality.

In this example, af:table is surrounded by af:panelCollection:


Let's say we will hide some column, one of them will be Email. Column is hided by setting Visible property to false:


On runtime, af:panelCollection will be rendered with View menu item and other features. It contains toolbar facet, I have dragged and dropped my buttons there. From View menu item I can select Columns section, where all table columns are listed. Those columns, hidden by default, are listed as well:


When user selects one from the list, for example Email, our table is refreshed and previously hidden column becomes visible:


Download sample application - PanelCollection.zip.

Spanish Summary:

Titulo: Esconder columnas en un Panel Collection.

Resumen: En este ejemplo observaremos como aprovechar el Panel Collection para definir columnas ocultas las cuales luego pueden ser mostradas dinĂ¡micamente por los usuarios.

4 comments:

havard said...

Nice!

But, of course, the users reply to this functionality will be: "It doesn't work, it won't remember my selections next time I start the application"... :-P

Andrejus Baranovskis said...

Hi,

For this advanced case, you can use MDS, so changes will be persistent across sessions.

Regards,
Andrejus

Anandsagar said...

Thank Andrejus,

Can you please provide a solution to PC issue ?
Issue is described here:
https://forums.oracle.com/forums/message.jspa?messageID=9773962#9773962

Rima Arvind said...

Hi,
Is there a way to hide the viewMenu conditionally. ie Hide viewMenu only if the search returns no data