2 Replies Latest reply on Jan 1, 2008 8:49 AM by galrub

    NotSerializableException: org.richfaces.component.html.HtmlT

    galrub

      Hi all, get this exception while modifying the Red-hat dev-studio JSF facelets kickStart D.WebApp : the Xhtml looks like this:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j">
      
       <f:loadBundle basename="resources" var="msg" />
      
       <ui:composition template="/templates/common.xhtml">
      
       <ui:define name="pageTitle">Input User Name</ui:define>
      
       <ui:define name="pageHeader">Facelets Hello Application</ui:define>
      
       <ui:define name="body">
       <h:message showSummary="true" showDetail="false" style="color: red; font-weight: bold;" for="name" />
       <h:form id="tab_test_form">
       <h:panelGrid columns="2" width="400px" style="text-align: center;">
       <h:inputText value="#{tabAddTest.name}" id="name"/>
       <a4j:commandButton actionListener="#{tabAddTest.doAddTab}" value="Add" reRender="panel"/>
       <rich:tabPanel binding="#{tabAddTest.panel}" id="panel"/>
       </h:panelGrid>
       </h:form>
       </ui:define>
       </ui:composition>
      </html>
      ---------
      and the managed bean (in session scope):
      package demo;
      
      import javax.faces.component.html.HtmlOutputText;
      import javax.faces.event.ActionEvent;
      
      import org.richfaces.component.html.HtmlTab;
      import org.richfaces.component.html.HtmlTabPanel;
      
      public class TabAddTest{
      
       private String name;
      
       private HtmlTabPanel panel;
      
       public String getName() {
       return name;
       }
      
       public void setName(String name) {
       this.name = name;
       }
      
       public HtmlTabPanel getPanel() {
       if(panel == null){
       panel = new HtmlTabPanel();
       }
       return panel;
       }
      
       public void setPanel(HtmlTabPanel panel) {
       this.panel = panel;
       }
      
       public void doAddTab(ActionEvent event)
       {
       HtmlTab tab = new HtmlTab();
       tab.setLabel(name);
       tab.setRendered(true);
       HtmlOutputText text = new HtmlOutputText();
       text.setValue("");
       tab.getChildren().add(text);
       if(panel == null){
       panel = new HtmlTabPanel();
       }
       panel.getChildren().add(tab);
       panel.setSelectedTab(tab);
       }
      }
      

      thanx all

      PS: tried to use the "ctrl-space" in an ui-component attribute after a '#{ ' and it does not work... only between elements.... any ideas?