My team got some problems with adding a new p:tab which contains ivycomponent. In the first tab of the p:tabview contains a p:datatable. A new p:tab should created/opened each time if the user clicks a row in the datatable.

In the new p:tab should include a ivycomponent with 2 parameters, which looks like following: alt text

Has anyone already gained experience with loading ivycomponent(s) within a dynamic p:tab? Thank you for sharing!

Kind regards

NWK Team

asked 05.03.2015 at 11:01

nwk2Team's gravatar image

accept rate: 0%

edited 05.03.2015 at 11:03

First the p:tabView should be bound to managed bean, so that we can access the UIComponent from code:

< !-- bind to a bean property so that we can manipulate it later in code: -->
< p:tabView id="tabs" binding="#{tabController.view}" />

The bean must at least contain the setters and be requestScoped:

public class TabController {
    private TabView view;
    public TabView getView() {
      return view;
    public void setView(TabView view) {
      this.view = view;

Then a new tab can be added from process logic. Its seems to be a little tricky to pass the start parameters correctly. They must be passed a string el-expression even if the object behind it is already resolved elsewhere: alt text

The full demo project can be downloaded here: ComponentCreation_51.iar


answered 06.03.2015 at 09:21

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
accept rate: 70%

edited 07.03.2018 at 10:33

Alex%20Suter's gravatar image

Alex Suter ♦♦

Hi Reguel,

Thank you for your demo. It works like a charm.

Kind regards

NWK Team

(06.03.2015 at 12:30) nwk2Team nwk2Team's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 05.03.2015 at 11:01

Seen: 5,278 times

Last updated: 07.03.2018 at 10:33