3 Replies Latest reply on Jun 13, 2008 9:00 AM by Fillo de Caes

    Creating rich:tabPanel from java code.

    Marcin Misiewicz Newbie

      I need to create tabPanel component from within backing bean.

      This is sample code :

       HtmlTab first = new HtmlTab();
       first.setLabel("first");
       first.setName("first");
       HtmlOutputText text1 = new HtmlOutputText();
       text1.setValue("first");
       first.getChildren().add(text1);
       HtmlTab second = new HtmlTab();
       second.setLabel("second");
       second.setName("second");
       HtmlOutputText text2 = new HtmlOutputText();
       text2.setValue("second");
       second.getChildren().add(text2);
       this.tabPanel.getChildren().add(first);
       this.tabPanel.getChildren().add(second);
      


      This code works ok, but I want to add facet to the HtmlTab and I don't know how to do this.
      I was trying use HtmlTab.setName method, I was passing HtmlOutputText object instance as a param of this method but I got NotSerializableException of the object HtmlOutputText.
      I'd like to have tab labels as links and close tab button on the right side of the link that's why I have to add facet.

      Another question is about HtmlTab.setName. When I don't set name of the HtmlTab object I got NullPointerException is this a bug ?

      Thanks in advance for your help

      Martin