ADF Basics: Reorder ADF table column using DisplayIndex property by Ashish Awasthi


clip_image001This post is about a very simple use case that is reordering of af:table column at run time.

Ordering of columns in af:table is controlled by DisplayIndex property of af:column
Check what docs says-
Default Value: -1
The display order index of the column. Columns can be re-arranged and they are displayed in the table based on the displayIndex. Columns are sorted based on the displayIndex property, columns without displayIndex are displayed at the end, in the order in which they appear. The displayIndex attribute is honored only for top level columns, since it is not possible to rearrange a child column outside of the parent column.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core

We can set DisplayIndex property for all columns in a sequence (1,2,3 etc) that we want to see on page
Here i am using a HashMap to change DisplayIndex of columns at runtime
Let’s see implementation part-

  • Prepare Model using Departments table of HR Schema and dropped viewObject as table on page

  Page structure window. Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.