3 Replies Latest reply on Aug 4, 2007 8:22 AM by wkzk

    method expressions with parameter in the nested <h:dataTable

      Hi.

      I have a problem that a method expressions with parameter in the nested <h:dataTable> doesn't work.

      this is the situation

      Parent class has a List named children. and xhtml is like this;

       <h:dataTable id="parent" var="parent" value="#{parents}">
       <h:column>
       <h:outputText value="#{parent.field1}"/>
       </h:column>
       <h:dataTable value="#{parent.children}" var="child" id="childrenList">
       <h:column>
       <h:outputText value="#{child.field1}"/>
       </h:column>
       <h:column>
       <h:outputText value="#{child.field2}"/>
       </h:column>
       <h:column>
       <s:link id="someAction" value="SomeAction"
       action="#{someAction.do(child)}" />
       </h:column>
       </h:dataTable>
       </h:dataTable>


      browsered html is fine.
      My problem is , in someAction#do method, child object is not null, but all field is a default value of the field type;

      Could you give me any hints?

      Thanks in advance.

      Shige


        • 1. Re: method expressions with parameter in the nested <h:dataT

          sorry , i forgot to say that
          I'm using seam v2.0beta.

          Thanks.

          • 2. Re: method expressions with parameter in the nested <h:dataT
            pmuir

            You need to outject datamodels not lists for extended EL to work like that I think.

            • 3. Re: method expressions with parameter in the nested <h:dataT

              Thank you for your reply.

              Although I didn't post it, I did try like this.

              @Name("someAction")
              public class SomeAction {
              
               @DataModel(value="parents")
               private List<Parent> parents;
              
               @DataModelSelection(value="parents")
               @Out(required=false, scope=ScopeType.CONVERSATION)
               private Parent parent;
              
               @DataModel(value="children")
               private List<Child> children;
              
               @DataModelSelection(value="children")
               private Child child;
              
              .......
              
              }


              @Entity
              @Name("parent")
              public class Parent {
              
               private int field1;
               private List<Child> children = new ArrayList<Child>(0);
              
               @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "parent")
               public List<Child> getChildren() {
               return this.children;
               }
              
              .......
              
              }


              But it didn't work....

              What am I missing?

              Shige