Hi All, How do I load a new page when I change tabs? I have two tabs in the panelTabbedPane: switch and customer. I would like the appropriate page to be loaded when I change tabs.
Thanks, Jaya -----Original Message----- From: Danimal [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 1:25 PM To: [email protected] Subject: Re: tabChangedListener question UPDATE: tabCahngeListener is working. I rebooted my machine and the code is breaking in the processTabChange method. Seems like it is the IDE ("bad Netbeans! bad!"). In any case, the code I have below is not rerendering the subviews I have in the panelTabbedPane. I am moving the subviews outside the panelTabbedPane to see if this will work. This is pretty kludgey as I was hoping to create tabPanes with the appropriate code inside to prevent from having to pull all the data everytime a tab is selected. If my methods or assumptions are incorrect and there is a better way, please feel free to let me know. panelTabbedPane has some short comings. Don't get me wrong, I love tomahawk and it is great, but it would be nice to have better examples as I imagine other people try to do the same thing with tabs by dynamically including content depending on which tab is selected. There really aren't any examples that illustrate this behavior that I found at least. Regards, Danimal Danimal wrote: > > This is the code I am using in my JSF code: > <t:panelTabbedPane bgcolor="#CCFFFF" serverSideTabSwitch="true"> > <t:tabChangeListener > type="ffldraft.presentation.rank.RankingsProfileWrapper"/> > <t:panelTab id="summarytab" label="summary" rendered="true"> > </t:panelTab> > <t:panelTab id="qbtab" label="#{msgs['positions.qb']}" > rendered="true"> > </t:panelTab> > <t:panelTab id="rbtab" label="#{msgs['positions.rb']}" > rendered="true"> > </t:panelTab> > <t:panelTab id="wrtab" label="#{msgs['positions.wr']}" > rendered="true"> > </t:panelTab> > <t:panelTab id="ktab" label="#{msgs['positions.k']}" > rendered="true"> > </t:panelTab> > <t:panelTab id="deftab" label="#{msgs['positions.def']}" > rendered="true"> > </t:panelTab> > <f:subview id="positionview" > rendered="#{profile.positionVisible}"> > <jsp:include page="/WEB-INF/jsp/rankposition.jspf"/> > </f:subview> > <f:subview id="summaryview" rendered="#{not > profile.positionVisible}"> > <jsp:include page="/WEB-INF/jsp/ranksummary.jspf"/> > </f:subview> > </t:panelTabbedPane> > > The listener calls a class that implements TabChangeListener that is also > my backing bean. I am not under the impression that it is calling the > instance of my backing bean in the session(which would be a bonus), but > this method should be called when a new tab is selected: > public void processTabChange(TabChangeEvent event) throws > AbortProcessingException { > int index = event.getNewTabIndex(); > positionVisible = true; > } > > So, the tabs are being rendered fine and the summaryview is being rendered > and positionview is not rendered as both should by default. However, it > seems like nothing is happening when a new tab is selected. I put my tool > in debug mode, I am using NetBeans 5.5 Beta 2, with breakpoints on both > lines in the method and the IDE is not breaking in the method. This makes > me suspect that the method is not being called, though it could be the > IDE. > > Any ideas on what I am missing with my implementation? Is it better to use > selectedIndex of panelTabbedPane and bind this to the backing bean? The > page with the example says this is only used to set the default index. > Does it also set the selectedIndex when a new tab is selected? Here is the > text from the example page at > http://myfaces.apache.org/tomahawk/tabbedPane.html, "selectedIndex - Index > of tab that is selected by default". > > Thank you for any help. > > Regards, > Danimal > -- View this message in context: http://www.nabble.com/tabChangedListener-question-tf2166413.html#a599072 2 Sent from the MyFaces - Users forum at Nabble.com.

