This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes how to retain rich:tabpanel's selectedTab Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "how to retain rich:tabpanel Watch "how to retain rich:tabpanel New topic
Author

how to retain rich:tabpanel's selectedTab

Chandana Gudimella
Greenhorn

Joined: Apr 29, 2008
Posts: 1
Hi,
We are using rich:tabPanel in our application and we are facing problem retaining the current selected tab after user clicks an commandButton pointing to an action in a Conversation. Everything seems to work fine during the normal post backs , but in case of errors and when seam redirects to my page to display errors, always the first tab is displayed.

I think one way to store the current tab is storing the current tab's name by using value binding to a property in the action, but that doesn't seem to be a good idea as I am mixing something related to GUI into my business logic.

Is there a way to retain this by only modifying the xhtml and probably pages.xml. I saw some code in seam forums , that uses <param name="selectTab"/> in pages.xml for that particular navigation case, I am not sure what is being achieved here.

Any help is greatly appreciated

Thanks
Chandana
Dan Allen
Author
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
In answer to your question about <param name="selectedTab"/> in the .page.xml file, this is a page parameter, which is Seam's way of propagating a value from page to page as you navigate (in lieu of a hidden form field). So you can bind this directly to the selectedTab attribute:



Remember, though that the selectedTab attribute can be a regular value binding to any Seam component property, so you can use a long-running conversation (or a page-scoped component) to continually update the selected tab. The value of this expression would be the label of the tag you want to select.

You might also be interested in the post below, which suggests a component-binding approach to manipulate the selected tab programmatically.

http://hobione.wordpress.com/2008/04/18/richfaces-tabs-switch-dynamically/

You might be interested to know that there is a book coming out soon about RichFaces. Such a book is desperately needed because while RichFaces is very powerful, there are many aspects of it that are either cryptic or just hard to grasp.
[ October 10, 2008: Message edited by: Dan Allen ]

Dan Allen | http://mojavelinux.com | Author of Seam in Action - http://mojavelinux.com/seaminaction
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retain rich:tabpanel's selectedTab
 
Similar Threads
Seam Identity login custom navigation
Question for Micheal Yuan and Thomas Heute: PageLoad and IsPostBack
modalpanel and seam page action
Calling JBoss Seam action methods from Servlet
Should I be using Seam?