Datatable rowSelect ajax event not fires listener

UI Components for JSF
Post Reply
uanderson
Posts: 1
Joined: 17 Aug 2011, 19:22

19 Aug 2011, 21:57

Dear users,

I'm using PrimeFaces M3-SNAPSHOT and i found a issue related to p:ajax on p:dataTable. The event rowSelect does not execute listener in the situation below:

First, my definition of p:dataTable:

Code: Select all

<p:dataTable var="item" value="#{relatedBean.lazyModel}" paginator="true" rows="15"
		     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
	   	     paginatorPosition="bottom" selection="#{relatedBeanBean.selected}"
	   	     rowsPerPageTemplate="15,20,25,30" lazy="true" selectionMode="single"
	  	     currentPageReportTemplate="({currentPage} de {totalPages})"
		     emptyMessage="Nenhum registro encontrado" id="relatedTable">

    <p:ajax event="rowSelect" listener="#{relatedBean.rowSelected}" update="form:especificComponent"></p:ajax>
     ... 
</p:dataTable>
Second, my bean method:

Code: Select all

public void rowSelected(SelectEvent event) {
     System.out.println("Hey, i'm here!");
}
What i observe was that the event was triggered, because update works fine, but, the rowSelected method is never executed. "Hey i'm here!" is never printed. The issue 2144, is about it, but, in the possible solution at primefaces-labs, does not exist a listener property in the p:ajax event, see: http://www.primefaces.org/showcase-labs ... leLazy.jsf.

The issue was classified as "CantReplicate". Someone had this problem?

My versions:
PrimeFaces: M3-SNAPSHOT
Mojarra 2.1.2
Tomcat 7.0.20

I appreciate the help and sorry about my english.

sleepn247
Posts: 1
Joined: 01 Oct 2011, 07:53

01 Oct 2011, 07:57

Hi,

(RC 3.0.3M, Glassfish 3.1)

I didn't have the same problem but I had an issue with selection when using lazy="true" (which I wonder if this relates to your issue). In my case I implemented getRowData(String rowkey) and I got it to work. Might want to look there.

Stefan Mondelaers
Posts: 3
Joined: 18 Aug 2016, 16:36

03 Oct 2016, 10:25

I was having a similar problem. I was implementing data table with a lazy model, paging and multiselection with checkboxes.
I added an AJAX event RowSelect with a listener but the listener didn't get called.
I wanted to implement two buttons who act upon the selected rows. So it seemed that that was impossible.

I found that my listener was invoked when selecting by clicking on a row but not when selecting by clicking the checkboxes. Further investigation showed that I just needed to use more events (5 instead of 2): I already used the rowSelect and rowUnselect event. I had to add rowSelectCheckbox and rowUnselectCheckbox for selecting and unselecting a row via the checkboxes and toggleSelect for the checkbox in the titlerow.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests