<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to dynamically open tab which binds a ivycomponent?</title><link>https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent</link><description>&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;In the new p:tab should include a ivycomponent with 2 parameters, which looks like following:
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/ScreenHunter_352_Mar._05_10.34.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Has anyone already gained experience with loading ivycomponent(s) within a dynamic p:tab?
Thank you for sharing!&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;NWK Team&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 06 Mar 2015 12:30:24 -0500</lastBuildDate><item><title>Comment by nwk2Team on Reguel Wermelinger's answer</title><link>https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent#1217</link><description>&lt;p&gt;Hi Reguel,&lt;/p&gt;
&lt;p&gt;Thank you for your demo. It works like a charm.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;NWK Team&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nwk2Team</dc:creator><pubDate>Fri, 06 Mar 2015 12:30:24 -0500</pubDate><guid>https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent#1217</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent/1214</link><description>&lt;p&gt;First the p:tabView should be bound to managed bean, so that we can access the UIComponent from code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt; !-- bind to a bean property so that we can manipulate it later in code:
&lt;a href="http://stackoverflow.com/questions/4052581/dynamically-generate-tabs-with-primefaces/4722270#4722270"&gt;http://stackoverflow.com/questions/4052581/dynamically-generate-tabs-with-primefaces/4722270#4722270&lt;/a&gt; --&amp;gt;
&amp;lt; p:tabView id="tabs" binding="#{tabController.view}" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The bean must at least contain the setters and be requestScoped:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@ManagedBean
@RequestScoped
public class TabController {
    private TabView view;
    public TabView getView() {
      return view;
    }
    public void setView(TabView view) {
      this.view = view;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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:
&lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/tabController.png"&gt;&lt;/p&gt;
&lt;p&gt;The full demo project can be downloaded here: &lt;a href="/upfiles/componentCreation_51.iar"&gt;ComponentCreation_51.iar&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Fri, 06 Mar 2015 09:21:09 -0500</pubDate><guid>https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent/1214</guid></item></channel></rss>