12 Replies Latest reply on Dec 19, 2011 4:33 PM by Jason Porter

    Method call in EL does not work in seam3

    Tomaz Cerar Master

      Hi,


      I have problems invoking methods on beans in seam 3 and jsf2(or jsf 2.1)


      as far as I have looked jsf 2 by default supports calling methods on beans or am I mistaken?


      my xhtml code looks like this:



      <span class="cardtype #{tr.creditCardType.name().toLowerCase()}">#{tr.ccname}</span>



      creditCardType is enum but that should not be the issue
      Exeption I get is




      17:43:45,522 WARN  [si.megapos.web.ExceptionHandler] Caught exception, redirecting to error page: javax.el.ELException: /admin/transactions.xhtml: The class 'com.parsek.megapos.runtime.CreditCardType' does not have the property 'name'.
              at com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94) [:2.1.0-FCS]
              at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82) [:2.1.0-FCS]
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302) [:2.1.0-FCS]
              at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) [:2.1.0-FCS]
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [:2.1.0-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) [:2.1.0-FCS]
              at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104) [:2.1.0-FCS]
              at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:512) [:2.1.0-FCS]
              at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:972) [:2.1.0-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) [:2.1.0-FCS]
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) [:2.1.0-FCS]
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [:2.1.0-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) [:2.1.0-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.0-FCS]
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.0-FCS]
              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401) [:2.1.0-FCS]
              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [:2.1.0-FCS]
              at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:157) [:]
              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [:2.1.0-FCS]
              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [:2.1.0-FCS]
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [:2.1.0-FCS]
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.0-FCS]
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.1.0-FCS]
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410) [:2.1.0-FCS]




      What am I doing wrong?


      cheers,
      tomaz