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.

5 comments:

  1. 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

    ReplyDelete
  2. Hi,

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

    Regards,
    Andrejus

    ReplyDelete
  3. 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

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

    ReplyDelete
  5. Hello Andrejus,

    Its a good blog post as always from you.

    I have a table with more than 15 columns when a click on view menu of panelCollection i can only see first 10 of them not all followed by manage columns.

    If i want to hide 15th column i will not be able to see it in list instead i need click on manage columns and again make it visible/hide the 15th column!

    now my question is can i make all the columns visible in the list itself?
    If yes how? If no why?

    Please Help!

    ReplyDelete