Thursday, January 28, 2010

ADF table - How to partial refresh on a specific column

Usecase:

adf table where a column has text field and a link to open a popup. Value for the text field is picked from popup. On return from popup, selected value need to be refreshed in text field. And each row has a check box to allow row selection.

Problem:
On return from popup, a partial refresh is preformed on the table, so that selected value is displayed in the text field. But this partial refresh will reset the selected check boxes.


Solution:
Instead of partial refresh to the whole table, do partial refresh on the specific column.

For example If the table name is "itemsTable" and column name is "catgName"
Do a partial refresh on "itemsTable:catgName"

Since the column is repeated for each row, ADF adds postfix like :1, :2 to make it unique. In this case the actual id of the text field will be catgName:1, catgName:2 etc. But we are giving partial refresh on "catgName" only. ADF is smart enough to figure out which column should be refreshed.