DataTable - Multiple Row Selection - Shift + click

UI Components for JSF
Post Reply
Stefanie
Posts: 5
Joined: 31 Oct 2011, 17:21

31 Oct 2011, 17:48

Hi,

I have following code in my xhtml:

Code: Select all

<p:dataTable id="mailOverview" 
			scrollable="true" scrollHeight="250" resizableColumns="true"
			var="mail"
			value="#{mailOverview.mailModel}"
			selection="#{mailOverview.selectedMails}" selectionMode="multiple">

			<p:ajax event="rowSelect" listener="#{mailOverview.onRowSelect}"
				update=":contentForm:contentDisplay :mailTableForm:mailOverview" />
If I select one row, the event is fired and then the setter of selectedMails is called with that one selected entry. If I then select another one with ctrl+click, the event is fired and setSelectedMails is called with two entries: the first selected and the second selected entry.
But if I select one and then use shift+click on another, it doesn't work the way I expect. My expectation is that the setter is called with the first selected, the second selected, and all entries between them. But instead it is called with all entries from the beginning of the table to the second selected entry.
Is my expectation wrong or how can I achieve this?

Thanks
PrimeFaces 3.0, Apache Tomcat 6.0.32

wind95
Posts: 1
Joined: 10 Apr 2013, 13:17

10 Apr 2013, 13:44

The very same problem in PF 3.5.0 :?
It looks like that feature of multiple selection in dataTable hasn't been finished yet...

Depends on whether or not the <p:ajax event="rowSelection"/> is within the p:dataTable... Selection with shift key works well without p:ajax, so how in this case to fill the selection list<> of the dataTable, when it should be filled on row selection :?: :?

Hah! The problem also is that rows, multiple selected with shift+click, doesn't have ajax behavior - they don't fire rowSelect event...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 84 guests