Wednesday, May 25, 2011

When disclosureListener of a panelTabbed's (OR) panelAccordion's showDetailItem is fired?

The showDetailItem component is used inside of a panelAccordion or panelTabbed component to contain a group of children. It is identified visually by the the text attribute value and lays out its children. Note the difference between "disclosed" and "rendered": if "rendered" is false, it means that this the accordion header bar or tab link and its corresponding contents are not available at all to the user, whereas if "disclosed" is false, it means that the contents of the item are not currently visible, but may be made visible by the user since the accordion header bar or tab link are still visible.

What really happens is that the disclosureListenerof all tabs (panelTabbed's showDetailItems) will be fired. And in order to resolve which tab was selected, you should use disclosureEvent.isExpanded()method.
eg.

public void prepareSomething(DisclosureEvent disclosureEvent) {
if (disclosureEvent.isExpanded()) {
...
}
}


No comments:

Post a Comment