File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes adding new tab to existing Tabbed Panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "adding new tab to existing Tabbed Panel" Watch "adding new tab to existing Tabbed Panel" New topic
Author

adding new tab to existing Tabbed Panel

Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 382
    
    2
Hi,

I am trying to add a new tab to an existing tabbed Panel. When user clicks on a row (in dataTable) a new tab should be added.

Below is the code of my action method.

HtmlTabbedPanel haTab= (HtmlTabbedPanel) findComponentInRoot("tabbedPanel1");
HtmlBfPanel bfPanel = new HtmlBfPanel();

bfPanel.setId("Manual");
bfPanel.setName("John Smith");
bfPanel.setRendered(true);
bfPanel.setShowFinishCancelButton(false);
haTab.getChildren().add(bfPanel);

This method is executing, however the new tab is not displayed. Please let me know whats the issue with the code.

I am using odc:tabbedPanel tag.

Thank you.

Regards
Ayub


SCEA part I,TOGAF Foundation
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You need to bind the component to the backing bean instead of obtaining it from the view root. Use the 'binding' attribute of the component to bind it with its component representation, the HtmlTabbedPanel.
Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 382
    
    2
I have part of the Tabbed Panel from existing jsp page. I need to add a new tab to this existing TabbedPanel on click of a row in Table. Could you give me some more hint or code example of doing this using the backing bean ?

Thank you
--Ayub
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding new tab to existing Tabbed Panel