jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [jsr372-experts mirror] Re: 1103-IterableInUIRepeatUIData

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Thu, 19 Feb 2015 13:07:33 +0100

On Thu, Feb 19, 2015 at 12:00 PM, Bauke Scholtz <balusc_at_gmail.com> wrote:
> Big +1. Finally support for Set (and thus also Map#entrySet()) in ui:repeat.

Ok, thanks!

> Would be even more cool if it transparently recognizes Map like c:forEach so
> we don't need value="#{bean.map.entrySet()}" everytime.

Good one, I do think that one requires a separate issue though.

Kind regards,
Arjan



>
> Cheers, B
>
> On Wed, Feb 18, 2015 at 6:11 PM, arjan tijms <arjan.tijms_at_gmail.com> wrote:
>>
>> Hi,
>>
>> As a relatively small thing that was left open from 2.2; issue 1103
>> deals with extending the support that 2.2 added for Collection in
>> UIData to UIRepeat, and additionally upgrading the support for both to
>> Iterable.
>>
>> I created a changebundle for that here:
>> https://java.net/jira/secure/attachment/54434/changebundle.txt
>>
>> I think it's a fairly low impact change; the test for iterable is the
>> last test, so for UIData the existing code will hit first for List and
>> then Collection if any such types are passed in, and only if the type
>> is none of these, but is Iterable, will the Iterable test hit and use
>> a new IterableDataModel.
>>
>> For UIRepeat there never was Collection support, so there the code
>> will hit if a Collection is passed in, as well as when an Iterable is
>> passed in.
>>
>> As for the implementation code, the IterableDataModel that is used has
>> been field tested in OmniFaces for some time now.
>>
>> Thoughts?
>>
>> Kind regards,
>> Arjan Tijms
>
>