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

[jsr372-experts] Re: Tag to declare and import constants in EL scope

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Mon, 20 Jun 2016 15:36:23 +0200

On Mon, Jun 20, 2016 at 3:24 PM, Bauke Scholtz <balusc_at_gmail.com> wrote:

> A faces-config.xml based configuration is a reasonable idea. Perhaps even
> better.
>

And/or the upcoming @FacesConfig ;)

Kind regards,
Arjan Tijms




>
> Cheers, B
>
>
> On Mon, Jun 20, 2016 at 3:14 PM, Leonardo Uribe <leonardo.uribe_at_irian.at>
> wrote:
>
>> Hi
>>
>> Just as a comment, f:importConstants reminds me f:loadBundle, which was
>> deprecated and replaced by a solution that loads the bundle from the
>> faces-config.xml files.
>>
>> The problem about f:importConstants is how to set up the context where
>> these constants are available. For example
>>
>> <f:importConstants type="com.example.Gender" />
>>
>> <h:selectOneMenu value="#{person.gender}">
>> <f:selectItems value="#{Gender}" />
>>
>> <f:ajax ...../>
>> </h:selectOneMenu>
>>
>>
>> if the ajax is only for the component, f:importConstants can be ignored
>> and the code will break.
>>
>> so, the "challenge" is to find a way to define the EL context properly.
>>
>> In MyFaces there are some EL contexts:
>>
>> - page
>> - template
>> - view
>> - global
>>
>> Sometimes you want a definition to pass through the template, sometimes
>> through the view or sometimes just have a global definition for all your
>> views.
>>
>> regards,
>>
>> Leonardo Uribe
>>
>>
>> 2016-06-20 14:49 GMT+02:00 Bauke Scholtz <balusc_at_gmail.com>:
>>
>>> Hi,
>>>
>>> See https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1424
>>>
>>> This is a commonly requested feature from the community. Several
>>> libraries have it implemented such as OmniFaces and PrimeFaces Extensions.
>>> It would be nice to offer a standard JSF solution such as
>>> <f:importConstants>. It's relatively trivial to implement.
>>>
>>> If there are no objections, I will take it on me.
>>>
>>> Cheers, B
>>>
>>>
>>>
>>
>