JSF EL overload method inheritance

36 Views Asked by At

Consider following scenario:

My Java classes:

public abstract class AbstractListBaseModel {
    public void onColumnToggle(ToggleEvent event) {
        // toggle column
    }
}

@Named
public class MyListModel extends AbstractListBaseModel {
    @Override
    public void onColumnToggle(ToggleEvent event) {
        // toggle column...
        super.onColumnToggle(event);
        // ...and do some more
    }
}

myList.xhtml:

<p:commandButton id="myToggler" .../>
<p:columnToggler trigger="myToggler" datasource="myListData">
    <p:ajax event="toggle" listener="#{myListModel.onColumnToggle}"/>
</p:columnToggler>

My application always calls the MyListModel.onColumnToggle() method and that is wha I want - but is this the guaranteed behavior? What You Can Not Do in EL mentions that EL doesn't support overloading.

And IntelliJ IDE shows both method declarations when moving the cursor over the listener!

0

There are 0 best solutions below