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

Posted: December 14, 2015 in JDeveloper & ADF
Tags: , , , , , ,

 

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: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s