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,

let me explain the problem a bit, maybe we can create a plain EL testcase then.
Not even sure if there is a nice way to support this. Maybe its even only a misuse of EL in JSF.

Here is a simple XHMTL:
<h:inputText>
    <f:ajax event="click" listener="#{bean.method}" />
</h:inputText>

In general JSF defines that this method can receive no params or AjaxBehaviorEvent (or even custom event in PrimeFaces but i will ignore this fact now).

java:
@Named
@RequestScoped
public class Bean {
    public void method() { }
    public void method(AjaxBehaviorEvent e) { }
}

So JSF use createMethodExpression with AjaxBehaviorEvent as parameter class and then invoke it.
This works when no params or AjaxBehaviorEvent is defined as parameter in the bean.


There is another case how a user can pass custom params to that method:

<f:ajax event="click" listener="#{bean.method(component)}" />

public void method(UIComponent component) { }

In this case "component" is resolved by a custom ELResolver.


The issue discussed in the GitHub link is a combination of both.
How can i receive the param from JSF (AjaxBehaviorEvent) and pass my custom UIComponent?

<f:ajax event="click" listener="#{bean.method(xxx, component)}" />

public void method(AjaxBehaviorEvent e, UIComponent component) { }


AFAIR someone of the PF users used it like this:
<f:ajax event="click" listener="#{bean.method(javax.faces.event.AjaxBehaviorEvent, component)}" />

But im not sure if this is supposed to work or just a random behavior of the EL impl?

Best regards,
Thomas


Am Di., 2. Feb. 2021 um 15:52 Uhr schrieb Manfred Riem <m_riem@xxxxxxxxxxx>:
Hi Mark,

This issue is still relevant

Thanks!

Kind regards,
Manfred Riem

-----Original Message-----
From: faces-dev <faces-dev-bounces@xxxxxxxxxxx> On Behalf Of Mark Thomas
Sent: Tuesday, February 2, 2021 5:05 AM
To: faces-dev@xxxxxxxxxxx
Subject: [faces-dev] Outstanding enhancement request for Jakarta EL

Hi all,

Now Jakarta EE 9 is done and we can start looking to evolve the Jakarta specifications I am working my way through the open issues for Jakarta _expression_ Language where I found this decade plus old request:

https://github.com/eclipse-ee4j/el-ri/issues/6

Is this still something that you are interested in seeing in EL? If so, we can look at what we can do for Jakarta EE 10 (and I'll probably have a bunch of additional questions). If not, I'll close the issue.

Thanks,

Mark
_______________________________________________
faces-dev mailing list
faces-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/faces-dev
_______________________________________________
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