3 Replies Latest reply on Sep 25, 2011 8:22 AM by antibrumm.mfrey0.bluewin.ch

    Problem of c:forEach and seam outject

    damnh.damnh.aureole-net.com.vn

      Hi,
      I have problem with c:forEach and @Out. My source code is following


      pages.xml



              <page view-id="/login.xhtml">
                      <navigation from-action="#{identity.login}">
                              <rule if="#{identity.loggedIn}">
                                      <redirect view-id="/test.xhtml"/>
                              </rule>
                      </navigation>
              </page>
      
              <page view-id="/test.xhtml">
                      <begin-conversation join="true"/>
                      <action execute="#{Bean.initialize}"/>
              </page>






      Bean.java



      @Stateful
      @Name("Bean")
      public class Bean implements BeanLocal {
              @Out(required = false)
              private List<TestDto> testList;
      
              public void initialize() {
                      testList = new ArrayList<TestDto>();
                      .........
                      // add values to testList
                      .........
              }
      
              /**
               * Destroy
               */
              @Remove
              @Destroy
              public void destroy() {
      
              }
      }




      test.xhtml



      ..........
      <table cellpadding="0" cellspacing="0" border="1" width="100%">
              <c:forEach var="t" items="#{testList}">
                      <tr>
                              <td height="50px">#{t.value}</td>
                      </tr>
      </table>
      .............






      If I use @Out for testList, page display nothing. But if I create getter/setter for testList, this page display my data.


      If using getter/setter for testList, test.xhtml is following



      test.xhtml



      ..........
      <table cellpadding="0" cellspacing="0" border="1" width="100%">
              <c:forEach var="t" items="#{Bean.testList}">
                      <tr>
                              <td height="50px">#{t.value}</td>
                      </tr>
      </table>
      ............





      Is it bug of c:forEach, I don't understand, please help me, I want to use @Out. Thank you.