3 Replies Latest reply on Oct 9, 2008 10:40 AM by Nicola Ben

    Property 'statusMessages'

    Nicola Ben Novice

      Hi,
      updating from 2.1.0.A1 to 2.1.0.CR1 I get the following exception:


      Caused by: javax.el.ELException: /layout/menu.xhtml @15,39 binding="#{loginInfo.toolBar}": Error writing toolBar on type my.domain.bean.LoginInfo_$$_javassist_6
           at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:101)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:240)
           ...
      Caused by: javax.el.PropertyNotFoundException: Property statusMessages not found on type org.jboss.seam.Namespace
           at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
           at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)



      I have seen the messages about Property statusMessages


      but I couldn't solve my problem.
      The binding which causes the problem is not a conversational component but a session one (the manual reports a problem and a workaround for conversational ones).


      @Scope(ScopeType.SESSION)
      @Name("loginInfo")
      public class LoginInfo implements Serializable {
          ...
          @Out(required=false)
          private UIToolBar toolBar;
      
          public UIToolBar getToolBar() {
           if (isLoggedIn()) {
               initToolbar(toolBar);
           }
           return toolBar;
          }
      
          public void setToolBar(UIToolBar toolBar) {
           this.toolBar = toolBar;
          }
      }




      XHTML 
      <rich:toolBar binding="#{loginInfo.toolBar}" rendered="#{identity.loggedIn}" />



      richfaces-api -ui and -impl are deploy as ejb modules and are in a ear's lib folder.


      Any suggestions, please?


      Thank u,
      nico

        • 1. Re: Property 'statusMessages'
          Pete Muir Master

          You can't inject conversation scoped objects into objects you use for JSF binding.

          • 2. Re: Property 'statusMessages'
            nimo stephan Master

            If you want to use binding in conversation-scope, then look at the SEAM-Reference:


            7.10. Conversational components and JSF component
            bindings

            • 3. Re: Property 'statusMessages'
              Nicola Ben Novice

              Hi,
              I followed the instructions from chapter 7.10 creating:



              @Name("menuToolBar")
              @Scope(ScopeType.EVENT)
              public class MenuToolBar extends HtmlToolBar {
                  
                  private HtmlToolBar toolBar;
              
                  public HtmlToolBar getToolBar() {
                      return toolBar;
                  }
              
                  public void setToolBar(HtmlToolBar toolBar) {
                      this.toolBar = toolBar;
                  }
              }



              Which is then injected in:



              @Scope(ScopeType.SESSION)
              @Name("loginInfo")
              public class LoginInfo implements Serializable {
                  ...
              
                  @In(required=false)
                  private MenuToolBar menuToolBar;
                   
                  public HtmlToolBar getMenuToolBar() {
                      if (isLoggedIn()) {
                          initToolbar(menuToolBar);
                      }
                      return menuToolBar;
                  }
              
                  public void setMenuToolBar(MenuToolBar menuToolBar) {
                      this.menuToolBar = menuToolBar;
                  }
              
              }
              



              In JSF now I call:



              <rich:toolBar binding="#{loginInfo.menuToolBar}" rendered="#{identity.loggedIn}"/>




              But I get this exception:



              javax.faces.FacesException: javax.el.PropertyNotFoundException: /layout/menu.xhtml @18,87 binding="#{loginInfo.menuToolBar}": Property 'menuToolBar' not writable on type org.richfaces.component.html.HtmlToolBar
                   at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:253)
                   at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:394)





              Where do I get wrong, please?


              Cheers,
              Nic