Friday, December 17, 2010

Programmatically disclosing a ShowDetailItem in a <af:panelTabbed>

In this post I'm sharing an example illustrating the programmatic disclosure of <af:showDetailItem> which is added inside a <af:panelTabbed>. Please note that while programmatically disclosing a showDetailItem, it's your responsibility to set the 'Disclosed' to false for the previously displayed item. To illustrate this, take a look at the following code snippet:

RichPanelTabbed richPanelTabbed = getPanelTabbed();
for (UIComponent child : richPanelTabbed.getChildren()) {
    RichShowDetailItem sdi = (RichShowDetailItem)child;
    sdi.setDisclosed(isThisItemToBeDisclosed(sdi));
}

Updated on 05 August 2013: See the code snippet in the following post if you application uses customization  http://www.jobinesh.com/2013/08/revisiting-topic-programmatically.html

You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11g R1 PS2]

How to run this sample?

Run the test.jspx. This page displays drop down list displaying the tab names and a button close to it for disclosing  the selected tab programatically.

3 comments:

sai_explorer said...

I have below structure in my page
af:paneltab
af:iterator->employeeVOIterator
af:showdetailitem

On click of add button, a new emp record is inserted and corresponding tab is reflected on page but not able to disclose this new tab among others.

Radamanthys17 said...

excellent thanks for the code

Srinivas Jilla said...

Hi Sai.. am also facing this issue. Were you able to resolve.


Thanks