[jsr-314-open] <h:dataTable> binding vs. ui:repeat

Andy Schwartz andy.schwartz at oracle.com
Fri Sep 4 14:46:06 EDT 2009


Finally read through this thread.  Fun stuff. :-)

Martin Marinschek wrote:
> Hi Ed,
>
>   
>> Which I still don't understand.  Can you please explain explicitly?
>>     
>
> I sent a mail to Kin-Man that we can't pass parameters from the
> framework to the method-expression. So, we can now do:
>
> #{bb.action(myparam)}
>
> to call a method with signature:
>
> public String action(String myparam) {}
>
> but we can not do:
>
> #{bb.valueChangeListener(myparam)}
>
> to call a method with signature:
>
> public void valueChangeListener(ValueChangeEvent ev, String myparam) {}
>
> only with signature:
>
> public void valueChangeListener(String myparam) {}
>
> so what we loose is the ValueChangeEvent, which was provided by the
> JSF framework as a parameter to the invoke-call in the
> Method-Expression instance (we will only receive the parsed
> parameters).
>   

An alternative that I believe we could implement in the JSF layer 
without any changes to the EL spec would be to provdie access to an 
implicit "event" object during event delivery.  The page author would 
specify:

> #{bb.valueChangeListener(event, myparam)}


Where bb.valueChangeListener is bound to:


> public void valueChangeListener(ValueChangeEvent ev, String myparam) {}

And the "event" implicit object is set up by JSF to point to the 
ValueChangeEvent (or more generally, to whatever FacesEvent we happen to 
be delivering) just prior to invoking any listeners.

This seems like a perfectly reasonable solution to me, and doesn't 
require any special handling of expected/actual parameter types in the 
EL layer.

Andy





More information about the jsr-314-open-mirror mailing list