This content has been marked as final.
Show 6 replies
-
1. Re: Loading page with tabPanel and immediately get to
ishabalov Aug 3, 2007 12:39 PM (in response to tonylmai)Use value attribute on tabPanel, it must point to the string equal to id of one of the tab. It works both way - if you change tab (and uses ajax or server switch type) it will be assigned to the active tab.
-
2. Re: Loading page with tabPanel and immediately get to
ilya_shaikovsky Aug 3, 2007 12:40 PM (in response to tonylmai)You may switch tabs with external components requests using name(Tab attribute) and selectedTab(Tab Panel attribute).
-
3. Re: Loading page with tabPanel and immediately get to
tonylmai Aug 4, 2007 2:03 PM (in response to tonylmai)So if I have a page call MyPage.xml that contains the following:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" ... <a4j:outputPanel> <rich:tabPanel> <rich:tab id="FirstTab" label="First"> Here is tab #1 </rich:tab> <rich:tab id="SecondTab" label="Second"> Here is tab #2 </rich:tab> </rich:tabPanel> </a4j:outputPanel> </ui:composition>
Let's say I have two links, one for each tab.<rich:toolBarGroup> <h:commandLink action="#{menu.gotoFirstTab}" title="Go to First Tab" /> <h:commandLink action="#{menu.gotoSecondTab}" title="Go to Second Tab" /> </rich:toolBarGroup>
And my menu bean:public String gotoFirstTab() { return "MyPage.xml" } public String gotoSecondTab() { return "MyPage.xml" }
In my menu bean, how would I program to call up the page and go to the corresponding tab on MyPage.xml?
Thanks for your help. -
4. Re: Loading page with tabPanel and immediately get to
tonylmai Aug 6, 2007 4:28 PM (in response to tonylmai)I am really stuck with this issue and can't go forward.
Can someone help?
Thanks
-tony -
5. Re: Loading page with tabPanel and immediately get to
ishabalov Aug 6, 2007 4:58 PM (in response to tonylmai)Pls take a look to richfaces-demo:
http://anonsvn.jboss.org/repos/richfaces/trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml
Note use of value attribute on tabPanel. Using this attribute you can switch tabs.
Like this:<rich:tabPanel value=#{menu.tab}> <rich:tab id="FirstTab" label="First"> Here is tab #1 </rich:tab> <rich:tab id="SecondTab" label="Second"> Here is tab #2 </rich:tab> </rich:tabPanel> public String gotoFirstTab() { setTab("FirstTab"); return null; } public String gotoSecondTab() { setTab("SecondTab"); return null; }
-
6. Re: Loading page with tabPanel and immediately get to
tonylmai Aug 6, 2007 6:03 PM (in response to tonylmai)Thanks ishabalov.