Add additional parameter to JSF Ajax event listener
<p>I am having an Ajax listener who should redirect to item view page. However since I am using generic type as model I would like to specify additionally in my common data table controller what is the view with a second parameter.</p>
<p>Unfortunately one can choose between two listener approaches one using <strong>event</strong> parameter which helps identifying the object and the second one gives you the opportunity to send <strong>free param</strong> but lacks the event.</p>
<p><strong>template</strong>:</p>
<pre class="lang-html prettyprint-override"><code>&lt;p:dataTable value=&quot;#{aObj.objList}&quot; var=&quot;item&quot; ... selectionMode=&quot;single&quot;&gt;
              
  &lt;p:ajax event=&quot;rowSelect&quot; listener=&quot;#{aObj.viewItem}&quot; /&gt;
  &lt;p:ajax event=&quot;rowSelect&quot; listener=&quot;#{aObj.viewItem('myItemView?_id=')}&quot; /&gt;

  ...
&lt;/p:dataTable&gt;
</code></pre>
<p><strong>controller</strong>:</p>
<pre class="lang-java prettyprint-override"><code>public void viewItem(SelectEvent event) {
  // ...
}
    
public void viewItem(String viewUrl) {
  // ...
}
</code></pre>
<p>I can add additional properties to the bean but since it is generic and providing model items doesn't feel right to pollute it.</p>
<p>Is there any workaround?</p>