0 Replies Latest reply on Nov 7, 2008 1:36 AM by elenctic87

    ElException caused by field being null on @Out variable

    elenctic87
      Hello,

      I have the conversation scoped component below.  Note the @Factory method for initializing the outjected field ListAuctions.  And there is a field with get/setters called curScenario.  Upon loading a page that uses this component, I get an ELException stating that curScenario can't be read because @Out on ListAuctions is required to be non-null.  But if I set ListAuctions to something that's not null ahead of time, the @Factory will never run (because the factory is triggered by ListAuctions being set to null).  The Exception does indeed go away if I initialize ListAuctions to something that is non null, but the factory method is never called (which is useless to me).  How do I get out of this dilemma? (curScenario can't be read because ListAuctions is null, but if ListAuctions is non-null, the factory is never called.)

      (I apologize for not formatting the code with backticks, but that was not working for me.)

      Code excerpt:

      `
      @Name("uifront")
      @Scope(ScopeType.CONVERSATION)
      public class UiFront {
                 
           @In protected EntityManager entityManager;
           

           private Scenarios curScenario;
           
           @Out
           private List<Auctions> ListAuctions;
         
           @Factory("ListAuctions")
           @Begin
           public void initListAuctions () {
                AuctionsList AL = new AuctionsList();
                ListAuctions = AL.getResultList();
                System.out.println ("================ initializing auctionslist");
           }
      `...

      Exceptions:
      Caused by: javax.el.ELException: /ui.xhtml @24,140 rendered="not null #{uifront.curScenario}": Error reading 'curScenario' on type org.domain.ds3.ui.UiFront_$$_javassist_98
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
           at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
           ... 56 more
      Caused by: org.jboss.seam.RequiredException: @Out attribute requires non-null value: uifront.ListAuctions
           at org.jboss.seam.Component.outjectAttribute(Component.java:1691)