DataTable 2.0.1 regression: no ajax deselect

UI Components for JSF
Post Reply
User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

23 Apr 2010, 18:05

Hello,

I have a data table

Code: Select all

<p:dataTable id="dtSocs" var="soc" value="#{socsBean.socs}" dynamic="false" selection="#{socsBean.selectedSocs}" 
   update="_mainForm_section1_scriptSocsMenubar" selectionMode="multiple" emptyMessage="" widgetVar="dtSocsWidget" rowIndexVar="rowIdxVar">
   ......
</p:dataTable> 
Before 2.0.1 release I could select / deselect rows and ajax requests were sent (Instant row selection with "selection" attribute). Now, in the current release deselect is not working more :-( Select is ok, ajax request is sent, but there is not ajax request for deselect.

Cagatay, please, restore the old behavior. Maybe you can fix this issue for the 2.0.2 release next week.

Many thanks in advance.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

23 Apr 2010, 18:12

You saw in datatable.js that you don't call doInstantRowSelectionRequest for onRowUnselect

Code: Select all

	onRowSelect : function(args) {
		var rowIndex = args.record.getData('rowIndex');
		
		if(this.isSelectionModeSingle())
			this.selectedRowIndexes[0] = rowIndex;
		else {
			if(this.selectedRowIndexes.length == 0 || this.getRowIndexPosition(rowIndex) == -1)
				this.selectedRowIndexes.push(rowIndex);		
		}
		
		document.getElementById(this.rowSelectParam).value = this.selectedRowIndexes.join(',');
		
		if(this.configs.update) {
			this.doInstantRowSelectionRequest();
		}
	},
	
	onRowUnselect : function(args) {
		var rowIndex = args.record.getData('rowIndex'),
		position = this.getRowIndexPosition(rowIndex);
		
		this.selectedRowIndexes.splice(position, 1);

		document.getElementById(this.rowSelectParam).value = this.selectedRowIndexes.join(',');
	}
I have created an issue http://code.google.com/p/primefaces/iss ... ail?id=767
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

30 Apr 2010, 15:51

Hello Cagatay,

Do we have a chance to get this bug fixed in the upcoming release 2.0.2? It's a critical bug in my opinion because instant row selection is not working correct at the moment. As result - table's update attribute is not working proper as well.

Thanks a lot.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

10 May 2010, 13:53

I created this issue a couple days ago http://code.google.com/p/primefaces/iss ... ail?id=767, but I see it was not targeted. No plans to add these lines to onRowUnselect?

Code: Select all

      if(this.configs.update) {
         this.doInstantRowSelectionRequest();
      }
It's a pity. As I already said it was working before the last release. We could push CTRL taste, click on a selected row and unselect request was sending.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

20 May 2010, 12:28

Any progress here Cagatay? Did you accept this or not?

Thanks.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 May 2010, 17:37

Ok, I've set the milestone to 2.0.2.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests