+1
Cheers, B
On Sun, Mar 8, 2015 at 11:22 PM, arjan tijms <arjan.tijms_at_gmail.com> wrote:
> Hi,
>
> As the third part of extending the data model wrappers for UIData and
> UIRepeat, it was suggested to make data model wrappers registrable by
> the user. Issue JAVASERVERFACES_SPEC_PUBLIC-1078 was created for this,
> but it was also mentioned as part of JAVASERVERFACES_SPEC_PUBLIC-1103.
>
> I took a quick look, and now with CDI available it seems almost
> trivial to implement this.
>
> JSF would provide a CDI qualifier annotation like:
>
> @Retention(RUNTIME)
> @Target(TYPE)
> @Inherited
> @Qualifier
> public @interface FacesDataModel {
> Class<?> forClass();
> }
>
> The user then provides something like the following:
>
> @FacesDataModel(forClass=MyObject.class)
> public class MyDataModel<E> extends DataModel<E> {
> // datamodel methods
> }
>
> The runtime then looks up an instance of that via CDI (just like
> happens now for CD Converters and Validators, which is almost a
> one-liner in Manfred's CDIUtils).
>
> Thoughts?
>
> Kind regards,
> Arjan Tijms
>