New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIRepeat and UIData supports Iterable #1103
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented Then, we the users should be able to register additional datamodel converters, so we can register something like OmniFaces' IterableDataModel and they would be automatically used by DataTable, UIRepeat and others. |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
I agree, and have adjusted the title of the issue to reflect that. If UIRepeat supports iterables, UIData should support that as well. Thanks for this suggestion! |
@glassfishrobot Commented
|
@glassfishrobot Commented |
@glassfishrobot Commented
The spec currently lists:
But java.util.Collection is missing, while this was added via a spec issue (#479). The new list would therefor become:
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:
|
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1103, UIRepeat and UIData supports Iterable" |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
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.\
The text was updated successfully, but these errors were encountered: