Differences between revisions 1 and 2
Revision 1 as of 2005-08-19 23:58:50
Size: 4325
Editor: fix-cable-customer
Comment: initial drop
Revision 2 as of 2009-09-20 23:01:32
Size: 4325
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

TabbedPane Memory

Authors: Alexander Jesse

An tabbed pane memory component is available as module TabMemory in cvs for the jsf-comp [http://sourceforge.net/cvs/?group_id=137466 ] project.

This tabbed pane memory component allows you to enable the t:panelTabbedPane component to remember the selected tab. Actually the panelTabbedPane will always display the first tab when the tap-page is called from some other page. For most cases this behaviour will be ok, but form some cases, eg when you kick off a wizard like search from one of the tabs, it might be more natural for the user if the flow comes back to the originating tab. Also in some cases it might be desirable to jump to a specific tab. The component consists of a TabChangeListener and a managed bean. The TabChangeListener just sets the managed beans selected tab index. The managed bean supplies the selected tab index, whenever the tab-page is displayed and offers an action method which allows to display a specific tab from a commandlink.

The cvs-module contains a (almost) complete web-application with the two classes and the necessary contents from MyFaces example application to demostrate the feature. Just add the jar-files from MyFaces into the /WEB-INF/lib folder, compile and deploy to a web-container.

For assistance, send email to "ajesse -at- users.sourceforge.net" or ask on the "myfaces user mailing-list".

To enable a tabbedPane to remember, just add a session-context managed bean to your application's faces-config.xml and add a t:tabChangeListener to the t:panelTabbedPane.

tab jsp-page

  <x:panelTabbedPane bgcolor="#FFFFCC"  selectedIndex="#{exampleTabbedPane.selectedIndex}">
    <x:tabChangeListener type="net.sf.jsfcomp.tabmemory.TabMemoryListener" />

To enable the linking to specific tabs, the managed bean needs to be configured with the navigation outcome leading to the tab-page and the "translation table" with the logical tab-names (correctly it is a list who's position index corresonds to the tab-index).




      tab-memory bean for the MyFaces example tabbed pane










        the state-holder attribute for the selected index













        the translations from the logical tab-name (not the labels shown to the users) to the tab-index








        the navigation outcome used to jump to the tabbed pane






      Navigation rule for the tabbed_pane.






"jump" jsp-page

  <h:commandLink id="goTab1" action="#{exampleTabbedPane.gotoTab}" immediate="true">
    <h:outputText value="Go to Tab 1"/>
    <f:param name="TabMemoryTabName" value="tab1"/>

In progress

Implementation notes

  • The component has also been tested against Sun's RI enhanced with the tomahawk-components.

change history of cvs-module

  • tab-memory-1-0 : initial drop

TabbedPaneMemory (last edited 2009-09-20 23:01:32 by localhost)