I have this dataTable with a list of Clients and one Edit commandLink column. I need to open a dialog to show the client's data and I'm trying to use f:setPropertyActionListener to send the Client object to the bean dialog, using the variable cli used for the dataTable's rows:
<p:dataTable id="tblClients" var="cli" value="#{clientsBean.clients}" rowKey="#{cli.id}">
<p:column>
<p:commandLink id="lnkEdit" value="Edit" action="#{clientBean.start}" process="@this" update="dlgClient" oncomplete="dialogClient.show()">
<f:setPropertyActionListener target="#{clientBean.client}" value="#{cli}" />
</p:commandLink>
</p:column>
<p:column headerText="Name" sortBy="#{cli.name}" id="name">
#{cli.name}
</p:column>
...
</p:dataTable>
But when I hit the Edit button, throws this error:
java.lang.IllegalArgumentException: Cannot convert test.Client@95 of type class java.lang.String to class test.Client
I'm sure clientBean.client is Client type and its getter and setter are correct.
Is it possible to reference the dataTable variable in any way? Do I need to implement a converter to accomplish this task?
Any help I will appreciate, Thanks.