Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: Components/Renderers
    • Labels:
      None

      Description

      I encountered a problem attempting to set the ui:repeat "value" attribute to an
      instance that was a subclass of java.util.Set (specifically Hibernate's
      PersistentSet class): the UIRepeat class treated it like a scalar object.

      An iteration tag like ui:repeat should work with all Collection types in my
      opinion. In the UIRepeat.getDataModel() method it's possible to detect an
      instance of Collection and make use of the ArrayDataModel by invoking the
      toArray() method on the instance. In this way a new DataModel implementation
      isn't needed. I've made this change in my own copy of Facelets and it works
      beautifully.

      Hibernate happens to use Sets quite a bit, so this was important to me. I'd be
      happy to submit a patch.

      This issue occurs in Facelets 1.2 as well.\

        Issue Links

          Activity

          Hide
          Ed Burns added a comment -

          I have some comments about the changebundle, but I'll add them on the impl issue JAVASERVERFACES-3785.

          Show
          Ed Burns added a comment - I have some comments about the changebundle, but I'll add them on the impl issue JAVASERVERFACES-3785 .
          Hide
          arjan tijms added a comment -

          The relevant text in the latest version of the spec is the following:

          The spec currently lists:

          • java.util.List
          • Array of java.util.Object
          • java.sql.ResultSet
          • javax.servlet.jsp.jstl.sql.Result
          • (Object wrapped as single row)

          But java.util.Collection is missing, while this was added via a spec issue (JAVASERVERFACES_SPEC_PUBLIC-479).

          The new list would therefor become:

          • java.util.List
          • Array of java.util.Object
          • java.sql.ResultSet
          • javax.servlet.jsp.jstl.sql.Result
          • java.util.Collection
          • java.lang.Iterable
          • (Object wrapped as single row)

          Also, a similar list appears in UIRepeat, but I can't find anything about that in the spec.

          The updated text in section 4.1.3.2 after this update (and after taking into account the change from 2.2) would be the following:

          The current value identified by the value property is normally of type DataModel. [P1-start-uidataModel]However, a DataModel wrapper instance must automatically be provided by the JSF implementation if the current value is of one of the following types:

          java.util.List
          Array of java.util.Object
          java.sql.ResultSet (which therefore also supports javax.sql.RowSet)
          javax.servlet.jsp.jstl.sql.Result
          java.util.Collection
          java.lang.Iterable
          Any other Java object is wrapped by a DataModel instance with a single row.[P1-end]

          Show
          arjan tijms added a comment - The relevant text in the latest version of the spec is the following: The spec currently lists: java.util.List Array of java.util.Object java.sql.ResultSet javax.servlet.jsp.jstl.sql.Result (Object wrapped as single row) But java.util.Collection is missing, while this was added via a spec issue ( JAVASERVERFACES_SPEC_PUBLIC-479 ). The new list would therefor become: java.util.List Array of java.util.Object java.sql.ResultSet javax.servlet.jsp.jstl.sql.Result java.util.Collection java.lang.Iterable (Object wrapped as single row) Also, a similar list appears in UIRepeat , but I can't find anything about that in the spec. The updated text in section 4.1.3.2 after this update (and after taking into account the change from 2.2) would be the following: The current value identified by the value property is normally of type DataModel. [P1-start-uidataModel] However, a DataModel wrapper instance must automatically be provided by the JSF implementation if the current value is of one of the following types: java.util.List Array of java.util.Object java.sql.ResultSet (which therefore also supports javax.sql.RowSet) javax.servlet.jsp.jstl.sql.Result java.util.Collection java.lang.Iterable Any other Java object is wrapped by a DataModel instance with a single row. [P1-end]
          Hide
          arjan tijms added a comment -

          Patch for ui:repeat's taglib/tld doc

          Show
          arjan tijms added a comment - Patch for ui:repeat's taglib/tld doc
          Hide
          arjan tijms added a comment -

          Oops, UIRepeat changes did not make it into previous bundle

          Show
          arjan tijms added a comment - Oops, UIRepeat changes did not make it into previous bundle
          Hide
          Manfred Riem added a comment -

          Applied to 2.3 trunk,

          svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1103, UIRepeat and UIData supports Iterable"
          Sending jsf-ri/conf/share
          Sending jsf-ri/conf/share/ui.taglib.xml
          Sending jsf-ri/conf/share/ui.tld
          Transmitting file data ..
          Committed revision 14464.

          Show
          Manfred Riem added a comment - Applied to 2.3 trunk, svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1103 , UIRepeat and UIData supports Iterable" Sending jsf-ri/conf/share Sending jsf-ri/conf/share/ui.taglib.xml Sending jsf-ri/conf/share/ui.tld Transmitting file data .. Committed revision 14464.

            People

            • Assignee:
              Manfred Riem
              Reporter:
              Ed Burns
            • Votes:
              13 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: