selectoneMenu in rowExpansion(in datatable) edited wrong row after sort

UI Components for JSF
Post Reply
JayJay
Posts: 9
Joined: 27 Mar 2013, 11:24

23 May 2017, 17:37

hey!

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>
Everything works fine, I can edit all rows until I sort the rows before!
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

guibernardi
Posts: 16
Joined: 19 Aug 2015, 15:16

03 Jun 2017, 15:58

Hello

Are your selectOneMenu keeping the value when you interact with rowToggler?

I'm having a issue which my selectOneMenu placed inside a rowExpansion + AccordionPanel becomes null after that.

I understand the behavior... rowToggler removes the row and render the row everytime we work with it, but I tried to gets the values using ajax listeners in the bean but they are already null.

Maybe if you founded any solution, can be useful for me.

Thanks in advance.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests