Note that there are some explanatory texts on larger screens.

plurals
  1. POPrimefaces DataTable sort issue
    text
    copied!<p>I have problem in a datatable. All columns have sortBy on header, except the last one that has a TieredMenu and each MenuItem calls to backing bean using item as parameter. Datatable is loaded with a List ordered by one field, I am not using a DataModel.</p> <p>The problem is that after order by any field the item passed as parameter is the initial and not the actual.</p> <p>For example:</p> <p>initially list is ordered by third field:</p> <pre><code>gomez 5 4 alvarez 3 5 carballo 3 8 </code></pre> <p>after order by first field:</p> <pre><code>alvarez 3 5 carballo 3 8 gomez 5 4 </code></pre> <p>If I click on first row I get gomez instead of alvarez.</p> <p>This is the code for the datatable:</p> <pre><code>&lt;p:dataTable scrollable="true" scrollHeight="290" value="#{bb.list}" id="tablaEnAtencion" var="item" width="100%" rows="10000" sortBy="#{item.third}" sortOrder="descending" filteredValue="#{bb.listFiltered}"&gt; ... &lt;p:column style="text-align:center;" width="24"&gt; &lt;p:commandButton id="dynaButtonAtencion" icon="ui-icon-gear" type="button" style="width:100%;" /&gt; ... &lt;p:tieredMenu overlay="true" trigger="dynaButtonAtencion" my="left top" at="left bottom" style="width:170px"&gt; &lt;p:menuitem value="action" actionListener="#{bb.act1(item)}" /&gt; &lt;/p:tieredMenu&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; </code></pre> <p>In the project I have a lot of DataTable and this issue only happens on this table. I've tried: - remove sort on some columns - adding sort event without listener - adding sort event with sort listener and on this method order by code the list - remove filter - use f:setPropertyActionListener to send values to bb</p> <p>Backing bean is ViewScoped. Primefaces 3.4, faces 2.1.13.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload