Tuesday, September 29, 2009

Tab selection and Enable User Customization on Session bug.

When you have enabled User Customization for duration of session then what ever user changes on a page it remains the same through out the session, ie. Disclosed panel boxes, advanced query criteria, visible columns of tables in panel collections etc.


The problem is that you cant customize which properties to be kept or not :
Fusion Developer's Guide for Oracle ADF & 34.3 Configuring User Customizations:
Note:
If you've enabled just session persistence, then all attribute values shown in Table 34-1 will be persisted to the session. There is no way to override this either globally or on an instance.

The bigger problem is that if you have some business logic about these components appearance or behavior you can’t override user settings.

We usually have some business logic about Disclosed tab in af:panelTabbed so I created this test case.

It’s a simple page that when you enter first tab should be disclosed and when you press button ‘Select Second tab’ second tab should be disclosed.

So I set disclosed property of First tab disclosed. Also on value change listener of button I run the following backing bean method:
public void SelectSecondTab(ActionEvent actionEvent) {
this.firstTab.setDisclosed(false);
this.secondTab.setDisclosed(true);
}

This work fine when I don’t have enabled User Customization.

But when I have enabled User Customization for duration of session then page always open with disclosed tab the one that I had selected the last time I used the page and backing bean method does not select the second tab.

Is this a bug?

Shouldn’t business logic methods override user customization settings?

Test case:
http://adfbugs.googlecode.com/files/TestTabSelection.zip

4 comments:

  1. Its not a bug, its conflict in functionality ;)

    Andrej

    ReplyDelete
    Replies
    1. Even i have the same problem, i need to get the selected tab back to default first tab.
      There is page 1 from where i go to page 2. (page 2 is having multiple tabs). On click of say 2nd tab (XYZ tab) , i do some edit action, save. Now i go back to pae 1. Again i am coming to page 2. Now XYZ tab is active with old data. I need the first tab to be active.
      What should i be doing for this?

      Delete
  2. I also came accross this feature;) The following works for me

    firstTab.setDisclosed(false);
    firstTab.queueEvent(new DisclosureEvent(firstTab, false));
    secondTab.setDisclosed(true);
    secondTab.queueEvent(new DisclosureEvent(secondTab, true));

    ReplyDelete
  3. It still doesn't work for me. Anyone found solution ? Andreas, can you paste your code for disclosure listener for firstTab & secondTab ?
    Appreciate any help.

    Thanks.

    ReplyDelete