The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Saturday, October 13, 2012

Refreshing Table Components for LOV bindings

Though this post is applicable for other type of bindings as well but just mentioning the use case where I found the issue and solved it. So, here is the scenario:

1. Create a VO having a at least one string attribute
2. Drop it on a page as a table from data control as a result a popup window will open up for selecting the type of component to use for table columns. In string type attribute choices will be like input text w/label, output text.
3. On clicking ok a table will be created on your page.
4. On trying to create a new row in the table you will see an input box for the string type column. So far so good.
5. Now, say you want this field to be a List of Values (LOV). So, you go ahead and enable LOV on the attribute in the VO, set UI hints accordingly.
6. On coming to page and clicking on the component the edit icon will be enabled. Clicking on this icon will bring the same popup which comes in step 2. However, in the list of components you will still see the old choices and no lov component.

So, the worst case fix for this problem is to delete the table and recreate it. However, this is not a good choice when you have already built your page and have made some changes etc to the table as all will be gone on delete. How to fix then?

There is a very useful option that comes to the rescue in this case. Right click on the table component on your page and select the "Rebind to another ADF control". This will open a popup window from where you can chose the same VO instance again and boom!  All will work fine. Only drawback is, if you had deleted some attributes previously then you have to redo that and things like order of display of the columns.

No comments: