Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [faces-dev] Outstanding enhancement request for Jakarta EL

Hi Mark,

sounds right but i will try to explain with some other words.

JSF always does:
MethodExpression me = ExpressionFactory#createMethodExpression(context, expressionString, new Class[] { AjaxBehaviorEvent.class })
me.invoke(context, new Object[] {  ajaxBehaviorEventInstance });

There are no 3 expressionStrings supported by it:

1) #{bean.method} / void method(AjaxBehaviorEvent e)
    This means that we receive the "implicit" parameter from JSF

2) #{bean.method()}  / void method()
   This means we receive no param

3) #{bean.method(someOtherVarWhichWillBeResolvedByELImplAndELResolver)} / void method(Object someVar)
    This means we receive a "explicit" parameter, defined by the user and resolved by a ELResolver

But this is not supported:

4) #{bean.method(???, someOtherVarWhichWillBeResolvedByELImplAndELResolver } / void method(AjaxBehaviorEvent e, Object someVar)
    This means that the user would like to take the "implicit" param from JSF and one or multiple "explicit" parameters.
    AFAIR someone of the PrimeFaces users wrote "javax.faces.event.AjaxBehaviorEvent" instead of "???" but not sure if its defined by the specs or even works correctly.

Hope its 100% understandable now :)

Best Regards,
Thomas


Am Do., 4. Feb. 2021 um 18:55 Uhr schrieb Mark Thomas <markt@xxxxxxxxxx>:
On 04/02/2021 17:46, Mark Thomas wrote:
> Hi Thomas,
>
> Thanks. I think I understand now. The issue is simpler than I realised
> from looking at the the Mojarra code.
>
> To summarise this from an EL perspective:
>
> When you create a MethodExpression you can either:
> - provide the parameters values; or
> - provide the parameter types.
>
> These are used to find the required method.
>
> When you invoke a MethodExpression you can either:
> - provide the parameter vales; or
> - if parameter values were provided at the point the MethodExpression
>   was created you can use those.

Small correction. Parameters provided at the point of creation take
priority over those provided at invocation.

> What you want to do is insert an additional parameter at the point the
> method is invoked.
>
> Does that sound right?
>
> Mark
_______________________________________________
faces-dev mailing list
faces-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/faces-dev

Back to the top