I have a simple implementation of p:orderList in which I display array list of task objects, namely task name and commandButton which displays more details about task:
<p:orderList value="#{taskBean.tasks}" var="t" controlsLocation="none"
itemValue="#{t}" id="tasks"/>
<p:column>
<h:outputLabel value="#{t.name}"/>
</p:column>
<p:column><h:form>
<p:commandButton title="Details" oncomplete="#{taskBean.details(t.id)}"
icon="ui-icon-document-b"/>
</h:form></p:column>
</p:orderList>
The button calls bean method which finds task in array list whit task id and displays it. Now for some reason, in all rows in orderList I end up whit last (t.id) as attribute for all buttons, so they all display the last task.
Any idea what should I do?
And my second question is how to add button which saves current order of the array list of tasks?