Help with SC error

I am getting an error from SC framework. Here is a fragment from Dev. console:

21:19:35.187:WARN:Log:Error:
	''null' is null or not an object'
	in http://localhost/beltrailway/mainapplication/forms/main.htm
	at line 726
    ListGrid.validateRowValues(_1=>null, _2=>Obj, _3=>1, _4=>Array[1])
    ListGrid.validateRow(_1=>1, _2=>undef)
    ListGrid.$27q(_1=>"click", _2=>1, _3=>0, _4=>0, _5=>0)
    ListGrid.startEditing(_1=>0, _2=>0, _3=>null, _4=>"click")
    ListGrid.handleEditCellEvent(_1=>0, _2=>0, _3=>"click")
    ListGrid.rowClick(_1=>Obj{ID:0}, _2=>0, _3=>0, _4=>undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef)
    [a]GridRenderer.rowClick(a=>Obj{ID:0}, b=>0, c=>0, d=>undef, e=>undef, f=>undef, g=>undef, h=>undef, i=>undef, j=>undef, k=>undef, l=>undef, m=>undef, n=>undef, o=>undef, p=>undef)
        "return this.parentElement.rowClick(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)"
    GridRenderer.$246(_1=>0, _2=>0)
    GridRenderer.click(Obj, undef)
        "if(this.$24x())return;var _1=this.getEventRow(),_2=this.getEventColumn();return this.$246(_1,_2)"
    Canvas.handleClick(_1=>Obj, _2=>undef)
    EventHandler.bubbleEvent(_1=>[GridRenderer ID:isc_ListGrid_337_body], _2=>"click", _3=>undef, _4=>undef)
    EventHandler.handleClick(_1=>[GridRenderer ID:isc_ListGrid_337_body], _2=>undef)
    EventHandler.$k5(_1=>Obj{type:error}, _2=>undef)
    EventHandler.handleMouseUp(_1=>Obj{type:error}, _2=>undef)
    EventHandler.dispatch(_1=>EventHandler.handleMouseUp(), _2=>Obj{type:error})
    anonymous(event=>undef)
        "var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"

The error happens if I use this code:


rowEditorExit : 
function (e, record, newValues, rowNum) 
{
 if (isc.isAn.emptyObject(newValues)) {
// suppress creation of new row if we're navigating away from
// an empty row
if (e == "arrow_down" || e == "tab") {
    return false;
} else if (e != "programmatic") {
// navigating 'up' into an existing row from an empty row
this.discardEdits(rowNum);
return true;
} 
}
return true;
}
and it happens when I am moving away from an empty edited record in the Grids. I can provide more details if you need. 

Thanks

Hi Mark,
We can’t reproduce this error over here. Can you provide us with the ListGrid definition (or even better, a standalone test case, which you could mail to support@isomorphic.com) , and any steps to reproduce.

Thanks
Isomorphic Software

I am posting my grid definition. As a quick reply. If it wont help I will put a sample together:

this.lstAlcoholDrugTests = isc.ListGrid.create({
			    dataSource: "AlcoholDrugTestInjuries", 
			    width: 500, 
			    height: 180, 
			    alternateRecordStyles:true, 
			    showAllRecords:true, 
			    showEmptyMessage: false,
			    autoSaveEdits: false,
			    emptyMessage:"",
			    cellHeight:22,
			    canEdit: true,
			    editEvent: "click",
			    listEndEditAction: "next",
		        canEditCell: 
	        	function (rowNum, colNum) 
	        	{
         			var record = this.getEditedRecord(rowNum);
         			if (record.nameselected == 1 && colNum != 0)
         			{
	         			return false;
	         		}	
	         		else
	         		{
	         			return true;
	         		}	
         		},
         		rowEditorExit : 
         		function (e, record, newValues, rowNum) 
	     		{
			        if (isc.isAn.emptyObject(newValues)) {
			            // suppress creation of new row if we're navigating away from
			            // an empty row
			            if (e == "arrow_down" || e == "tab") {
			                return false;
			            } else if (e != "programmatic") {
			                // navigating 'up' into an existing row from an empty row
			                this.discardEdits(rowNum);
			                return true;
			            } 
			        }
			        return true;
			    },
			    fields:[
			        {name: "name", title: "Name", valueField: "id", displayField: "name",
			         optionDataSource:"Tforce", editorType: "comboBox", type: "text", required: true,
			         editorProperties: 
      				 {keyPress: function () 
      				 	{
      				 		var inValidChars = "0123456789@#$%^&*()-_=+[]{}\|;:',.<>/?" + '"';
      				 		var keyName = isc.EventHandler.getKey();
				            if (inValidChars.indexOf(keyName) == -1)
      				 		{
      				 			return true;
      				 		}	
      				 		else	
      				 			return false;
      				 	},
      				 changed: function (dynform, thisObj, newValue)
			         	{
		         			if (newValue != null && newValue != '' && !isNaN(newValue))
		         			{					         	
					         	Tforce.fetchData({id:newValue}, 
					         		function (dsResponse)
					         		{
					         			var rowNumber = Alcohol.lstAlcoholDrugTests.getEditRow();
					         			// disable editing
					         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "nameselected", 1);
					         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "occupation", dsResponse.data[0].occupation);
					         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "company", "BRC");
					         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "worknum", dsResponse.data[0].worknum);
					         			Alcohol.lstAlcoholDrugTests.endEditing();
					         		}
					         	);
					        }	
					        else
					        {
			         			var rowNumber = Alcohol.lstAlcoholDrugTests.getEditRow();
			         			// enable editing
			         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "nameselected", 0);
			         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "occupation", '');
			         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "company", '');
			         			Alcohol.lstAlcoholDrugTests.setEditValue(rowNumber, "worknum", '');
					        }	
			         	}
			         }	
			        },
			        {name: "occupation", title: "Occupation", type: "text", length: 50, width:150,
			         validators:[{type:"isString"}]
			        },
			        {name: "company", title: "Company", type: "text", length: 20, width:100,
			         validators:[{type:"isString"}]
			        },
			        {name: "worknum", title: "Work Number", type: "integer", length: 5, width:85,
			         validators:[{type:"isInteger"}]
			        }
			   	]
		});

Hi Mark,
Thanks for the grid definition. We managed to reproduce the issue - the problem is that our 5.6 code isn’t anticipating the edit row being dropped in response to rowEditorExit like this.

We’ve fixed this for the 5.7 release. This release should be being made public extremely soon (in the next week or so), and when you upgrade the problem will go away.
If you need a workaround in the meantime, let us know

Thanks
Isomorphic Software

O, this is great news!! At least something is not my fault :slight_smile:
I can definetely wait till the official release.