2 Replies Latest reply on Oct 12, 2010 6:29 AM by ahoehma

    rich:dataTabel an TreeSet not working

    ahoehma

      Hihi folks,

       

      a little question about "collections" and datatable ... I can't run the following example

       

      // javacode

      treeset = new TreeSet<Foobar>();

      treeset.add(new Foobar("peter"));

      treeset.add(new Foobar("paul"));

      treeset.add(new Foobar("mary"));

      // Foobar.getName() ... available

       

      // facelets

      <rich:dataTable value="#{treeset}" var="item">
              <rich:column>
                <h:outputText value="#{item.name}" />
              </rich:column>

      </rich:dataTable>

       

      Caused by: javax.el.PropertyNotFoundException: /WEB-INF/facelets/tree-test.xhtml @60,63 value="#{item.name}": The class 'java.util.TreeSet' does not have the property 'name'.
              at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)
              at javax.faces.component.UIOutput.getValue(UIOutput.java:73)
              at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getValue(RendererUtils.java:327)

       

       

       

      org.ajax4jsf.component.SequenceDataAdaptor.getDataModel() will create:

       

      model = new SequenceDataModel(new ScalarDataModel(current)); ... is there a problem with that?!

       

      regards

      andreas

      -[http://www.ahoehma.de]-