Thursday, February 9, 2017
Showing The First Tab On PanelTabbed Component In WebCenter Portal ( Spaces )
This issue of showing First tab on panelTabbed component in webcenter portal ( Spaces ) has troubled me for long.
Page A has three tabs. When user select second or third tab and then navigate to another page. When user comes back to Page A, his last selected tab is displayed instead of first tab.
Google Search for showing first tab on panelTabbed component gives you lot many results...and mostly works for adf application. Found a very little for webcenter portal framework ...but none for webcenter portal ( spaces ),
I knew that it has something to do with MDS ...disclosed tab getting persisted. Also verified that using RedSamurai MDS Cleaner taskflow. There were MDS file getting created persisting disclosed tab information.
Found the solution ...
http://dba-adf.blogspot.com/2014/02/showing-first-tab-always-when-enabling.html
public void tabDisclosureListener(DisclosureEvent disclosureEvent) {
RichShowDetailItem tab = (RichShowDetailItem)disclosureEvent.getComponent();
FacesContext fc = FacesContext.getCurrentInstance();
ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager();
ComponentChange cc = new AttributeComponentChange("disclosed", Boolean.FALSE);
cm.addComponentChange(fc, tab, cc);
........
}
This will reset the disclosed property when ever any of the tabs where clicked.
Enjoy !!!