Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF / Primefaces dataTable and sorting issue
    primarykey
    data
    text
    <p>I am using PrimeFaces 2.2, with JSF 2.0.3.</p> <p>I have an xhtml view that contains the following datatable:</p> <pre><code>&lt;p:dataTable id="fooTable" widgetVar="fooTable" rowKey="#{foo.id}" var="foo" value="#{fooQueue.foos}" styleClass="table" selection="#{fooQueue.selectedfoo}" filteredValue="#{fooQueue.filteredfoos}" paginatorPosition="bottom" paginatorAlwaysVisible="true" selectionMode="single" rowEditListener="#{fooQueue.save}" paginator="true" rows="10" rowIndexVar="#{foo.id}" emptyMessage="No foos found with given criteria" rowStyleClass="#{foo.status == const.submitted ? 'gray' : null}" onRowSelectUpdate=":form:deleteValidation"&gt; &lt;p:column id="mothersName" filterBy="#{foo.header1}" filterMatchMode="contains"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Mother's Name" styleClass="tableHeader2" /&gt; &lt;/f:facet&gt; &lt;p:commandLink action="#{fooQueue.next(foo)}" ajax="false" disabled="#{foo.status == const.submitted || foo.id == 0}"&gt; &lt;f:setPropertyActionListener value="#{foo}" target="#{fooQueue.selectedfoo}" /&gt; &lt;h:outputText value="#{foo.header1}" styleClass="tableData" /&gt; &lt;/p:commandLink&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{foo.header4}" &gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="DOB" styleClass="tableHeader2" style="width: 400px" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{foo.header4}" styleClass="#{(foo.overSevenDays and foo.status != const.submitted and foo.id != 0)?'tableDataRed':'tableData'}" /&gt; &lt;/p:column&gt;&lt;/p:dataTable&gt; </code></pre> <p>.. with the following backing bean:</p> <pre> <code> @ViewScoped @ManagedBean public class FooQueue extends BaseViewBean { private List foos; private Foo selectedFoo; private List filterdFoos; public FooQueue() { logger.debug("Creating new FooRegQueue"); retrieveFooRecords(); } private void retrieveFooRecords(){ foos = new ArrayList(); foos.addAll(fooService.getAllFoos()); } public String next(Foo clickedFoo) { System.out.println(clickedFoo.getId()); return ""; } public Collection getFoos() { return foos; } public Foo getSelectedFoo() { return selectedFoo; } public void setSelectedFoo(Foo foo) { if (foo != null) { this.selectedFoo = foo; } } public void setFilterdFoos(List filterdFoos) { this.filterdFoos = filterdFoos; } public List getFilterdFoos() { return filterdFoos; } } </code> </pre> <p>Note the "commandLink" on the mother's name column, and the "sortBy" on the DOB column. </p> <p>I've encountered a strange issue, which seems to be limited to IE, where if I sort the data by DOB, then paginate to the last page and click the commandLink of the last record in the table, it fires two action events. The first event correctly reports that I clicked on the last record in the sorted table. But the second invocation of the next() method is for the last record in the UNsorted table.</p> <p>Can anyone identify anything wrong with my xhtml, or backing bean? Is this a known PrimeFaces issue? A known IE issue?</p> <p>I am testing with IE 8.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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