1 Reply Latest reply on Mar 17, 2009 9:53 AM by Sascha Janz

    binding on panelgroup from bean scopetype page

    Sascha Janz Master
      i use a rich:tabpanel on my page. with a binding on a panelgroup to dynamically insert content.

      page is

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                  "http://www.w3.org/TR/html4/strict.dtd">
                 
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:rich="http://richfaces.org/rich"
           xmlns:a4j="http://richfaces.org/a4j">
               
      <h:form id="test">
      <rich:tabPanel switchType="server">
        <rich:tab id="panel1" label="Tab1" >
        <h:form>
        <h:outputText value="#{Panel1.text}" />
      </h:form> 
        </rich:tab>
          <rich:tab id="panel2" label="Tab2"  >
         
          <h:form>
          <h:panelGroup binding="#{Panel2.group}"></h:panelGroup>
        <h:outputText value="#{Panel2.text}" />
        </h:form>
        </rich:tab>
        <rich:tab id="panel3" label="Tab3"  >
        <h:form>
        <h:outputText value="#{Panel3.text}" />
        </h:form>
        </rich:tab>
        
      </rich:tabPanel>
      </h:form>

      </ui:composition>


      the bean code is

      package de.lorenz.soaworkflow.components.page;

      import javax.faces.component.html.HtmlPanelGroup;

      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Create;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.log.Log;

      @Name("Panel2")
      @Scope(ScopeType.CONVERSATION)
      public class Panel2Bean {
           
           String text = "Panel2";
           
           @Logger private Log log;
           
           
           
          @Create
          public void create(){
               log.debug("Bean created");
          }
          
          @Destroy
          public void destroy(){
               log.debug("Bean destroyed");
          }
           

          HtmlPanelGroup group;
         

           public HtmlPanelGroup getGroup() {
                return group;
           }

           public void setGroup(HtmlPanelGroup group) {
                this.group = group;
           }

           public String getText() {
                return text;
           }

           public void setText(String text) {
                this.text = text;
           }
           

      }


      when i click on panel2 i got

      13:43:16,439 ERROR [ExceptionFilter] handling uncaught exception
      javax.servlet.ServletException: /test/test.xhtml @22,45 binding="#{Panel2.group}
      ": Target Unreachable, identifier 'Panel2' resolved to null

      why?