very special question, I hope you can help me!
I have a datatable with rowexpansion and a acordionpanel which contains some selectonemenu's and a update Button looks like this (reduced!):
Code: Select all
<p:datatable id="animals" value="#{animaladmin.animals}" var="animal" widgetVar="animals" rowKey="#{animal.AId}">
<p:column>
</p:column>
.
.
.
<p:column>
<p:rowToggler />
</p:column>
<p:rowExpansion>
<p:accordionPanel id="acp" multiple="true" dynamic="true">
<p:tab>
<p:selectOneMenu id="rings" value="#{animal.ring}" converter="converterRing" widgetVar="#{animal.AId}" >
<f:selectItem itemLabel="-"/>
<f:selectItems value="#{animaladmin.ringsfrombreeder}"/>
</p:selectOneMenu>
<p:commandButton id="sabtn" widgetVar="sabtn_#{animal.AId}" value="save" action="#{animaladmin.updateAnimal(animal)}" update="animals" />
</p:tab>
</p:datatable>
If I sort the datatable before I edit a row, it overrides the wrong row (the row which was on this position before sort).
I tried some things with the widgetVar, but without any success.
My Application:
JSF2.2
Netbeans 8.1
Glassfish Server 4.1.1
Primefaces 6.1