we are developing a web application using Oracle ADF. In this we have a page with tabbedpane as show below
In the above picture we have two tabs Account Payable and Accounts Receivable. Each tab is having green and red image(this is a commandImage). When user clicks any image means red or green he will be navigated to another page. In that page we have provided another button called Back. This tabbedpane and another page(second page) are .jsff and We dropped it as a region. Our problem is when user clicks back button in another page it is always showing first tab even though he clicked a button in second tab.
So we need to achieve the following.
If user clicks red or green image in first tab and when he clicks back button he has to be redirected to first tab.
If user clicks red or green image in second tab and when he clicks back button he has to be redirected to second tab.
How do we achieve this. Please help. Thanks in advance.
Presuming you are having backing bean on Session scope - myBean :
<af:panelTabbed id="pt1">
<af:showDetailItem disclosureListener="#{myBean.tabSelected}" text="Accounts Payable" disclosed="#{myBean.selectedTab == "sdi1"}" id="sdi1"/>
<af:showDetailItem #{myBean.tabSelected} text="Accounts Receivable" disclosed="#{myBean.selectedTab == "sdi2"}" id="sdi2"/>
</af:panelTabbed>
And you bean should look have :
public MyBean {
private String tabSelected; //make sure you add getter and setter too!!!
public void tabSelected(DisclosureEvent disclosureEvent) {
if (disclosureEvent.isExpanded()) {
UIComponent uiComp = (UIComponent)disclosureEvent.getSource();
tabSelected = uiComp.getId();
}
}
}
Your backing bean can have pageFlowScope as well, if both pages are part of the same bounded task flow.
More details, here:
https://docs.oracle.com/middleware/1212/adf/TROAF/tagdoc/af_showDetailItem.html
http://adfhowto.blogspot.co.uk/2011/05/when-disclosurelistener-of-paneltabbeds.html