0 Replies Latest reply on Apr 7, 2011 6:00 AM by Lukáš Fryč

    Dynamically generated tabPanel stored in view scope

    Lukáš Fryč Master



      I have tried to create simple sample of using dynamically generated tabPanel.

      I decided to use list of strings using view scoped bean:


      But the sample doesn't work when list stored in view scope, otherwise it works once it is stored in session scope:



      public class RichBean implements Serializable {
                private List<String> list = new LinkedList<String>(Arrays.asList(new String[] {"a", "b", "c"}));
                public List<String> getList() {
                          return list;
                public void add() {
                          list.add("new" + list.size());



                <rich:tabPanel switchType="ajax">
                          <c:forEach items="#{richBean.list}" var="tab">
                                    <rich:tab label="#{tab}" id="#{tab}" name="#{tab}">
                                              Tab: #{tab}
                <h:commandButton action="#{richBean.add}" render="@form" />