I have an ajax listener that should redirect to the item view page. However, since I am using the generic type as a model, I would like to further indicate in my generic data controller what constitutes a view with a second parameter.
Unfortunately, you can choose between two approaches of the listener using the event parameter , which helps to identify the object, and the second gives you the opportunity to send a free parameter , but does not have an event.
template
<p:dataTable value="#{aObj.objList}" var="item" .... selectionMode="single">
<p:ajax event="rowSelect" listener="#{aObj.viewItem}" />
<p:ajax event="rowSelect" listener="#{aObj.viewItem('myItemView?_id=')}" />
...
</p:dataTable>
controller :
public void viewItem(SelectEvent event) {
}
public void viewItem(String viewUrl) {
}
I can add additional properties to the bean, but since it is shared and the provision of model elements has no right to pollute it.
Is there a workaround?