I am using RF3.3 and JSF(2.0) wiht JSPs in the project.
My page contains 4 tabs inside a tab panel.
When page is first loaded, the TAB1 is automatically selected which is ok.
Now before user navigate from one tab to another tab I need to show him a pop up panel asking his confirmation to move from one tab to another. So when User present on TAB 1 clicks on TAB2 I want a pop up panel asking user whether he is sure to navigate to TAB2.
The problem is: Once I click tab 2 the action listener present with <rich:tab> is fired and tab2 is rendered and only then pop up panel comes.
Is there any way to open pop up panel once user click on TAB 2 and only if he clicks YES in pop up panel the contents of TAB 2 is shown.
I cannot use disabled attribute since using that I won’t be able to click on TAB 2 and my pop up panel won’t open.
<rich:tabPanel id="tab" switchType="ajax" headerSpacing="10px"style="overflow:auto">
<rich:tab binding="#{Bean.firsttab}" id="tabOne" style="overflow:auto" styleClass="richTab" label="TAB ONE" actionListener="#{Bean.refresh}" switchType="ajax">
<rich:tab binding="#{Bean.secondtab}" id="tabTwo" style="overflow:auto" styleClass="richTab" label="TABTWO" actionListener="#{Bean.refresh}" switchType="ajax">
</rich:tabPanel>
I preferably don’t want to use Javascript to achieve the same. How can I achieve this in JSF?
I achieved the same by binding the tab with the backing bean and using the property of the tab to render and rerender the tab based on some conditions…