Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#11188 closed defect (fixed)

dojox.grid throws null pointer exception when calling _delayedCellFocus

Reported by: kludgeless Owned by: Karl Tiedt
Priority: high Milestone: 1.6.2
Component: DojoX Grid Version: 1.5.0b2
Keywords: Cc: Evan
Blocked By: Blocking:

Description (last modified by bill)

There are a number of places in dojox/grid/_FocusManager.js where we check if the column head node is null before performing blurHeader, and only one where we don't which throws exceptions under some circumstances:

	_delayedCellFocus: function(){
		if(this.isNavHeader()||!this.grid._focused){
				return;
		}
		var n = this.cell && this.cell.getNode(this.rowIndex);
		if(n){ 
			try{
				if(!this.grid.edit.isEditing()){
					dojo.toggleClass(n, this.focusClass, true);
					this.blurHeader();
					dojox.grid.util.fire(n, "focus");
				}
			} 
			catch(e){}
		}
	},

We should add a check in the code as follows before calling blurHeader:

Index: _FocusManager.js
===================================================================
--- _FocusManager.js	(revision 1571)
+++ _FocusManager.js	(working copy)
@@ -104,7 +104,9 @@
 			try{
 				if(!this.grid.edit.isEditing()){
 					dojo.toggleClass(n, this.focusClass, true);
-					this.blurHeader();
+					if (this._colHeadNode){
+						this.blurHeader();
+					}
 					dojox.grid.util.fire(n, "focus");
 				}
 			} 

Change History (12)

comment:1 Changed 9 years ago by bill

Component: GeneralDojoX Grid
Description: modified (diff)
Owner: changed from anonymous to bryanforbes

comment:2 Changed 9 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:3 Changed 8 years ago by Karl Tiedt

Any reason to prolong committing this? Ran across this bug in 1.6 still (obviously not closed) I came to the same conclusion for fixing it, just looked for dupe bugs before opening a new one and found this....

comment:4 Changed 8 years ago by Karl Tiedt

Owner: changed from Bryan Forbes to Karl Tiedt
Status: newassigned

claiming to get this fixed... just using my patch since I actually found an additional spot where blurHeaders was being called w/o checking

comment:5 Changed 8 years ago by Karl Tiedt

Resolution: fixed
Status: assignedclosed

(In [25140]) fixes #11188 - should these _colHeadNode checks be replaced with isNavHeader() checks instead?

comment:6 Changed 8 years ago by Adam Peller

Cc: evan added
Milestone: tbd1.7

Karl, are the ticket refs backwards on those two checkins?

comment:7 in reply to:  6 Changed 8 years ago by Karl Tiedt

Replying to peller:

Karl, are the ticket refs backwards on those two checkins?

Crap, yes they are :/

comment:8 Changed 8 years ago by Adam Peller

see [25141]

comment:9 Changed 8 years ago by evan

(In [25157]) Refs #11188 backport to 1.6 branch

comment:10 Changed 8 years ago by evan

(In [25158]) Refs #11188 backport to 1.6 branch

comment:11 Changed 8 years ago by Adam Peller

Milestone: 1.71.6.2

comment:12 Changed 8 years ago by Evan

Cc: Evan added; evan removed
Note: See TracTickets for help on using tickets.