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

[jsr372-experts] Re: Validate client IDs in f:ajax execute and render

From: Bauke Scholtz <balusc_at_gmail.com>
Date: Tue, 19 Jul 2016 08:58:57 +0200

There are basically two ways to solve this:

1. Strip off anything which matches the iteration index :[0-9]+: from
f:ajax execute/render client ID before passing to findComponent() for
validation.
2. Improve findComponent to recognize the iteration index and act
accordingly.

The first way is trivial. The second way, however, is best to implement if
all repeater components (UIData and UIRepeat at least) share a common
interface such as UIIterable. Only, this is not really nice for backwards
compatibility.

What do you think?

Cheers, B


On Mon, Jul 11, 2016 at 6:00 AM, Josh Juneau <juneau001_at_gmail.com> wrote:

> +1, I think that since this change will help to clarify the spec for
> newcomers, it is a good idea.
>
> Josh Juneau
> juneau001_at_gmail.com
> http://jj-blogger.blogspot.com
> https://www.apress.com/index.php/author/author/view/id/1866
>
>
> On Sun, Jul 10, 2016 at 5:39 AM, Bauke Scholtz <balusc_at_gmail.com> wrote:
>
>> Hi,
>>
>> Since Mojarra 2.2.5 (https://java.net/jira/browse/JAVASERVERFACES-2958)
>> the f:ajax stopped validating client IDs in execute and render attributes
>> with the reason to support updating a specific ui:repeat/h:dataTable
>> iteration round such as render="form:repeat:0:item" which updates only the
>> first item of ui:repeat.
>>
>> However, this has the side effect that new JSF users now start asking
>> questions why f:ajax execute and/or render doesn't seem to have any effect
>> while there's a clear syntax error or typo in the execute and/or render
>> attribute. Previously they are been notified about this much sooner by a
>> clear exception. It appears that this validation is not part of JSF spec.
>>
>> Therefore I propose to bring back validation of client ID in f:ajax
>> execute and render attributes and make it part of the spec. I already
>> created an issue on this:
>> https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1372
>>
>> I only wonder what's the best place in spec to state that. AjaxBehavior
>> class?
>>
>> Cheers, B
>>
>
>