7 Replies Latest reply on Oct 24, 2007 6:03 AM by Pete Muir

    Facelets variable injection?

    Sean Burns Newbie

      Hello,

      I am busy building a custom facelets component that I will use like this

      <tns:autoForm compvar="#{testList}"/>
      <tns:autoForm compvar="#{anotherTestList}"/>
      


      Where testList and anotherTestList are List objects that has been outjected by seam.

      Now on the component side of things I can use the variable "compvar"
      <h:dataTable var="item" value="#{compvar}">
      .
      .
      .
      </h:dataTable>
      <h:outputText value="#{helper.compVarSize}/>"


      Now the trouble I have is with my "helper" component that has the method getCompVarSize()... I need access to whichever variable is passed to my component (testList or anotherTestList).
      Idealy I would like to write this piece of code

      @Name("helper")
      public class SomeExample {
      
       @In
       List compvar; // this does not work
      
       public String getCompVarSize() {
       ...
       }
      }


      This of course does not work becasue compvar is not a seam component... does any one know how I can do this?

      Thanks.
      Sean.