Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Chart error DrawPath:isc_DrawPath_5:Error: NOT_SUPPORTED_ERR: DOM Exception

    Hi, I'm trying to evaluate your charting functionality in advance of a potential feature sponsorship.

    I used the sample code in your Feature Explorer to generate a chart like this from a List Grid:

    Code:
        chartType:"Area",
        updateChart : function (chartType) {
            // store chart configuration
            if (chartType) this.chartType = chartType;
            // or pick up the (possibly changed) chartType from the last chart
            else if (this.lastChart) this.chartType = this.lastChart.chartType;
    
            // if there's already a chart, destroy it
            if (this.lastChart) this.lastChart.destroy();
    
            // generate chart
            this.lastChart = this.chartData("ticker");
            
            //isc.Log.logInfo("this.lastChart=" + this.lastChart);
    
            // show it
            fundAssetChartsContainer.addMember(this.lastChart, 0);
    
        },
    The Grid currently has 3 columns: Ticker, 52 week high, 52 week low

    When chartData() executes above, I get the following error:

    18:25:17.848:TMR1:WARN:DrawPath:isc_DrawPath_5:Error: NOT_SUPPORTED_ERR: DOM Exception 9 [No error.stack available]

    That is from Chrome and Firefox gives something very similar like this:
    DrawPath:isc_DrawPath_103:[Exception... "Operation is not supported" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"

    IE seems to fail silently.

    I'm using the latest versions of all browsers.

    Any suggestions on how to figure out what is happening?

    #2
    What version is this related to?

    Do you have any troubles using the sample in the SDK?

    Are there valid numeric values for all records for the field(s) you are charting? If you're not sure, please show the data.

    Comment


      #3
      I am using 8.2 (build 2.23.12)

      No problems with the samples in the SDK. They are valid numerical values.

      I've recreated the problem with a sample you can drop into the SDK. I'm just getting started with this so I may be doing something terribly wrong. But, I was just trying to mimic the grid charting sample in the Feature Explorer. So, can you tell me why this sample errors ouT when creating the chart? You just right click on the Animals grid and select Charts and you'll see the error:


      Code:
      <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
      <HEAD><TITLE>
              SmartClient SDK - Animal Data Binding example
      </TITLE>
      
      <style>
      
      input.file {
      	position: relative;
      	text-align: right;
      	-moz-opacity:0 ;
      	filter:alpha(opacity: 0);
      	opacity: 0;
      	z-index: 2;
      color:#CCCCCC;
      
      }
      
      .uploadControl{
      width:500px;
      color:#CCCCCC;
      }
      
      </style>
      
      </HEAD><isomorphic:loadISC skin="SmartClient" includeModules="Drawing,Charts"/>
      <BODY BGCOLOR=#D3D3D3>
      
      <SCRIPT>
      
      <isomorphic:XML>
      <jsp:include page="../shared/ds/animals.ds.xml"></jsp:include>
      </isomorphic:XML>
      
      
      	isc.RPCManager.addClassProperties({
      		//defaultTransport:"hiddenFrame"
      	});
      
      	var faDS = isc.DataSource.getDataSource("animals");
      	faDS.addMethods({
      
      
          fetchData : function (record, callback, requestProperties) {
              if (requestProperties == null) requestProperties = {};
              //do not use this short fetch below here for FundAsset
              //if (requestProperties.timeout == null) requestProperties.timeout = 1000;
              if (requestProperties.prompt == null) requestProperties.prompt = "fetching1_test";
              return this.Super("fetchData", [record, callback, requestProperties]);
          },
          updateData : function (record, callback, requestProperties) {
              if (requestProperties == null) requestProperties = {};
              if (requestProperties.prompt == null) requestProperties.prompt = "saving_test";
              if (requestProperties.timeout == null) requestProperties.timeout = 2000
              return this.Super("updateData", [record, callback, requestProperties]);
          },
          addData : function (record, callback, requestProperties) {
              if (requestProperties == null) requestProperties = {};
              if (requestProperties.prompt == null) requestProperties.prompt = "adding_test";
              if (requestProperties.timeout == null) requestProperties.timeout = 2500;
              return this.Super("addData", [record, callback, requestProperties]);
          },
      
      
          transformRequest : function (dsRequest) {
            
            dsRequest.data = stripDSFields(dsRequest.data, faDS.fields,true,true,false);
            dsRequest.oldValues = stripDSFields(dsRequest.oldValues, faDS.fields,true,true,false);
      
            var params = {
                    cvsTag : "cvsTag_1",
                    browser:"Firefox",
                    browserVersion:"3.6",
                    browserOS:"Windows",
                    requestUserID: 1,
                    departmentID: 2,
                    companyID:3
                 };
      
      
      	if(isc.getValueForKey("test1ID",dsRequest.data)=="test1ID" ){
      		params.test1ID=14;
      	}
      	if(isc.getValueForKey("test2ID",dsRequest.data)=="test2ID" ){
      		params.test2ID=28;
      	}
      
      	if(isc.getValueForKey("test3ID",dsRequest.data)=="test3ID" ){
      
      		if(at.initialLayoutComplete){
      			params.test3ID=28;
      		}else{
      			params.test3ID=null;
      		}
      	}
      
      
      
      
      	  return isc.addProperties({}, dsRequest.data, params);
          }
      	})	
      
      
      var at={};
      
      isc.setAutoDraw(false);
      
      	isc.Window.addProperties({
      		showHeaderBackground:false,
      		//canDragResize:true,
      		//showFooter:true,
      		//showResizer:true,
      		autoDraw: false,
              autoCenter: true,
              autoSize: true,
              dismissOnEscape: true,
              showCloseButton: true,
              showMinimizeButton: true
      	})
      
      var demoApp={};
      
      isc.HTMLFlow.create({
          	ID:"animalMessage",
          	padding:10,
              width:650,
          	contents:"Animal Details"
      		});
      
      
      isc.HTMLFlow.create({
          	ID:"animalMessage2",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage3",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage4",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage5",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage6",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage7",
          	padding:10,
          	contents:"Animal Details<br/><a style='display:inline' href='#' onclick='showAssetNotesWindow(null,true,null);' title='add notes'>add notes</a>"
      		});
      
      
      isc.DynamicForm.create({ID:"assetNotesEditor",
      overflow: "auto",
      fields:[{name:"assetID", type:"select",width:150,allowEmptyValue:false,colSpan:3, title:"asset",prompt:"prompt"},{name:"subject", cellStyle:"uploadControl",colSpan:3,width:150, prompt:"subject"},{name:"source", colSpan:3,width:150, prompt:"source"},{name:"attachedFile",title:"attachment",type:"binary",cellStyle:"uploadControl", prompt:"attachment test"},{name:"notes", showTitle:true, colSpan:3,height:375,width:"*", prompt:"notes"}],itemHoverAlign:"left",itemHoverHeight:100,itemHoverWidth:200,height:465,numCols:4,width:700,colWidths:[100,80,80,"*"]});
      
      
      isc.DynamicForm.create({ID: "assetNotesWindowSave",numCols:4,width:"650",height:"25",itemHoverAlign:"left",itemHoverHeight:100,itemHoverWidth:200,colWidths:[100,120,80,"*"]});
      
      
      
      function showAssetNotesWindow(record,add,assetID){
      
      
      
      	
      	if(at.assetNotesWindow==null || !at.assetNotesWindow.isVisible() || !at.assetNotesWindow.isDrawn()){
      
      		if(at.assetNotesWindow==null){
      			var windowTitle = "notes";
      			at.assetNotesWindow = isc.Window.create({
      				title: windowTitle,
      				items: [ assetNotesEditor,assetNotesWindowSave ]
         	 		});
            		 
      		}
      
      	}
      	
      	
      	assetNotesEditor.markForRedraw();
      	at.assetNotesWindow.show();
      	at.assetNotesWindow.bringToFront();
      	
      }
      
      isc.HTMLFlow.create({
          	ID:"animalMessage8",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.HTMLFlow.create({
          	ID:"animalMessage9",
          	padding:10,
          	contents:"Animal Details"
      		});
      
      isc.DynamicForm.create({
      	ID: "animalGamesSummary",
      	itemHoverAlign:"left",
      	itemHoverHeight:100,
      	itemHoverWidth:200,
        	editEvent:"click",
      	overflow: "auto",
      	emptyMessage:"empty"
      });
      
      function updateAnimalGamesSummary() {
      
      	animalGamesSummaryFields = [
       		{type:"rowSpacer", height:10},
      		{name:"animalSummary"}
       	];
      	animalGamesSummary.setFields(animalGamesSummaryFields);
      
      
      }
      
      isc.DynamicForm.create({
      	title:"Games Editor",
      	ID:"animalGamesEditor",
        	overflow: "auto",
        	itemHoverAlign:"left",
      	itemHoverHeight:100,
      	itemHoverWidth:200,
          emptyMessage:"empty"
      });
      
      function updateAnimalGamesEditor() {
      
      	animalGamesEditorFields = [
       		{type:"rowSpacer", height:10},
      		{name:"animalGamesEditor"}
       	];
      	animalGamesEditor.setFields(animalGamesEditorFields);
      
      
      }
      
      isc.DynamicForm.create({
      	title:"Data",
      	ID:"animalDataEditor",
        	overflow: "auto",
        	itemHoverAlign:"left",
      	itemHoverHeight:100,
      	itemHoverWidth:200,
          emptyMessage:"empty"
      });
      
      function updateAnimalDataEditor() {
      
      	animalDataEditorFields = [
       		{type:"rowSpacer", height:10},
      		{name:"attachedFile",type:"binary"},
      		{name:"animalDataEditor"}
       	];
      	animalDataEditor.setFields(animalDataEditorFields);
      
      }
      
      isc.HLayout.create({
      	ID:"animalGamesSummaryLayout", 
      	members:[
              animalGamesSummary,
              animalGamesEditor,
              animalDataEditor
          ]
      });
      
       isc.DynamicForm.create({
       	ID: "animalGamesSave",
      	autoDraw:false,
      	numCols:5,
      	width:"100%",
      	itemHoverAlign:"left",
      	itemHoverHeight:100,
      	itemHoverWidth:200,
      	colWidths:[80,80,80,80,"*"]
       });
      
       function updateAnimalGamesSave(){
       	animalGamesSaveFields=[
      
         	  	{type:"button",  cellPadding:0,  startRow:false,endRow: false,prompt:"edit",title:"Edit", showTitle:false, showLabel:false},
         	  	{type:"button",  cellPadding:0,  startRow:false,endRow: false,prompt:"edit",title:"Add", showTitle:false, showLabel:false, click:"animalGamesGrid.startEditingNew();"}
      
          ];
        
          animalGamesSave.setFields(animalGamesSaveFields);
       
       }
      
      isc.ListGrid.create({
      	ID:"animalGamesGrid",
      	headerHeight:36,
      	height:125,
      	canHover:true,
      	hoverWidth:150,
      	hoverHeight:50,
      	hoverAlign:"left",
      	hoverVAlign:"center",
      	canSort:false,
      	stopOnErrors:true,
      	headerButtonProperties:{
              hoverWidth:200, hoverHeight:100, hoverAlign:"left", hoverVAlign:"center"
          },
      	listEndEditAction:"next",
      	autoSaveEdits:false,
      	editEvent:"click",
      	emptyMessage:"empty",
      	alternateRecordStyles: true,
      
      	fields:[
                  {name:"lifeSpan", width:50,canEdit:true,formatCellValue:"if(grid == animalGamesGrid) return formatNumber(value,0,'years','after',false)" },
      		{name:"gameName",  canEdit:true, prompt:"Game"}
      
      	]
      })
      
      isc.SectionStack.create({
      	ID:"animalGamesSections", 
      	className:"borderBR",
          visibilityMode:"multiple", 
          backgroundColor:"white",
      	sections:[
          	{ expanded:true, items:[animalGamesGrid],showHeader:false},
          	{ expanded:true, items:[animalGamesSave],showHeader:false},
      	{ expanded:true, items:[animalGamesSummaryLayout],showHeader:false}
          ]
      });
      
      isc.SearchForm.create({
          cellPadding:4,
          numCols:8,
      	itemHoverAlign:"left",
      	itemHoverHeight:100,
      	itemHoverWidth:200,
          ID:"findAnimalsForm"
      })
      
      function showQuickAddGrid(){
      	
      	    updateQuickAddGrid(); 
      
      	if(demoApp.quickAddWindow==null || !demoApp.quickAddWindow.isVisible() || !demoApp.quickAddWindow.isDrawn()){
       
      	     demoApp.quickAddWindow = isc.Window.create({
                  title: "quick add",
                  items: [ quickAddGrid ]
              });
      
      		quickAddGrid.setData([]); 
      
      
      	demoApp.quickAddWindow.show();
         	demoApp.quickAddWindow.bringToFront();
      	quickAddGrid.cancelEditing();
      	quickAddGrid.discardAllEdits();
      	quickAddGrid.markForRedraw();
      	quickAddGrid.delayCall("focus");
      	quickAddGrid.delayCall("startEditingNew");
      
          }
          
      
      
      }
      
      
      //handles getting the grid's data whether the grid is grouped or ungrouped
      function getGridDataSet(grid,invalidateCache, useOriginalData, checkIfAllDataLoaded){
      	
      	if(grid==null){
      		return null;
      	}
      	
      	var dataSet=grid.data;
      	if( ( useOriginalData==null ||useOriginalData) && grid.isGrouped && grid.originalData!=null){
      		dataSet=grid.originalData;
      	}
      	
      	var dataLoaded = false;
      	var allDataLoaded=false;
      	var dataSetLength;
      
      	if(grid.isGrouped){
      		if(grid.originalData!=null){
      			dataLoaded = isA.Function(grid.originalData.lengthIsKnown) && grid.originalData.lengthIsKnown();
      			
      			if(dataLoaded){
      				//isc.Log.logInfo("in getGridDataSet, checking dataSetLength and rangeIsLoaded on grid.originalData");
      				dataSetLength = grid.originalData.getLength();
      				allDataLoaded = isA.Function(grid.originalData.rangeIsLoaded) &&  grid.originalData.rangeIsLoaded(0, dataSetLength);
      			}
      		}
      	}else{
      		if(grid.data!=null){
      			dataLoaded = isA.Function(grid.data.lengthIsKnown) && grid.data.lengthIsKnown();
      			
      			if(dataLoaded){
      				//isc.Log.logInfo("in getGridDataSet, checking dataSetLength and rangeIsLoaded on grid.data");
      				dataSetLength = grid.data.getLength();
      				allDataLoaded = isA.Function(grid.data.rangeIsLoaded) &&  grid.data.rangeIsLoaded(0, dataSetLength);
      			}
      		}
      	}
      	
      
      	
      	if(invalidateCache && dataSet!=null && dataSet!=''){
      
      
      		if(allDataLoaded){
      			
      			//data is loaded, now we check whether the entire range is loaded to determine
      			//if we can safely invalidate
      
      				if(grid.isGrouped){
      					//isc.Log.logInfo("in getGridDataSet invalidating cache, calling ungroup");
      					grid.ungroup();
      				}
      				//isc.Log.logInfo("in getGridDataSet, calling invalidateCache");
      				dataSet.invalidateCache();
      				//isc.Log.logInfo("in getGridDataSet invalidating cache done");
      
      		}
      		
      
      	}
      	
      	if((checkIfAllDataLoaded==null || checkIfAllDataLoaded) && !allDataLoaded){
      		//isc.Log.logInfo("all data not loaded, returning null");
      		dataSet=null;
      	}
      
      	return dataSet;
      	
      }
      
      
      
      isc.Menu.create({
      	ID:"animalMenu",
      	showKeys:true,
      	data:[
      		{title:"Add", click:function () {showQuickAddGrid();}},
      		{title:"Charts", click:function () {showCharts();}}    
          ]
      });
      
      
      function showCharts(){
      
      		
      
      		if(typeof animalChartsContainer=='undefined'){
      			isc.VLayout.create({
      			    membersMargin: 10,
      			    ID: "animalChartsContainer",
      			    members: [ ]
      			});
      		}
      
      		animalsGrid.updateChart();
      		
      		if(at.chartsWindow==null || !at.chartsWindow.isVisible() || !at.chartsWindow.isDrawn()){
      
      	     	at.chartsWindow = isc.Window.create({
      	            title: "charts 777",
      	            width:800,
      	            height:400,
      	            showResizer:true,
      	            items: [ animalChartsContainer ]
      	        });
      			
      		}
      		
      
      		
          	at.chartsWindow.show();
             	at.chartsWindow.bringToFront();
      	
      
      
      }
      
      ListGrid.create({
                  ID:"animalsGrid",
          chartType:"Column",
          updateChart : function (chartType) {
              // store chart configuration
              if (chartType) this.chartType = chartType;
              // or pick up the (possibly changed) chartType from the last chart
              else if (this.lastChart) this.chartType = this.lastChart.chartType;
      
              // if there's already a chart, destroy it
              if (this.lastChart) this.lastChart.destroy();
      
              // generate chart
              this.lastChart = this.chartData("commonName");
              
              //isc.Log.logInfo("this.lastChart=" + this.lastChart);
      
              // show it
              animalChartsContainer.addMember(this.lastChart, 0);
      
          },
                  dataSource:"animals",
      		canEdit:false,
                  contextMenu:animalMenu,
      		virtualScrolling:false,
          		selectionType:"none",
          		recordClick : function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
          			nextRecord=record;
      			showDetails();
          		}, 
             	headerHeight: 36
              })
      
      isc.ListGrid.create({
          ID: "quickAddGrid",
          headerHeight: 36,
          height:400,
      width:400,
      	listEndEditAction:"next",
      	canSort:false,
      	canHover:true,
      	hoverWidth:150,
      	hoverHeight:50,
      	hoverAlign:"left",
      	hoverVAlign:"center",
      	stopOnErrors:true,
      	canEdit:false,
      	headerButtonProperties:{
              hoverWidth:200, hoverHeight:100, hoverAlign:"left", hoverVAlign:"center"
          },
      	canEdit:true,
      	autoSize: true,
      	autoSaveEdits:true,
      	alternateRecordStyles: true,
      
      	editComplete:function(rowNum,colNum,newValues,oldValues,editCompletionEvent,dsResponse){
      
          		var dataSet = getGridDataSet(animalsGrid);
      		isc.Timer.setTimeout("quickAddGrid.startEditingNew();",0);
      			
      	},    
          dataSource:animals
      });
      
      isc.TabSet.create({
      	ID:"animalTabs",
      	height:380,
      	tabs:[
      		{title:"Games", pane:animalMessage, ID:"animalGamesTab", width:70},
      		{title:"Notes", pane:animalMessage, ID:"animalNotesTab", width:70},
      		{title:"Food", pane:animalMessage, ID:"animalFoodTab", width:70},
      		{title:"Details", pane:animalMessage, ID:"animalDetailsTab", width:70}
      
      	]
      });
      
      <%-- right-side layout--%>
      isc.SectionStack.create({
      	ID:"rightSections", 
      	overflow:"auto",
      	className:"borderBR",
          visibilityMode:"multiple", backgroundColor:"white",
      	sections:[
            {title:"View Options", expanded:true,resizeable:false, items:[{children:[findAnimalsForm],height:30}]},      			
          	{title:"Grid", canCollapse:false, expanded:true, items:[animalsGrid]},
          	{title:"Detail", resizeable:false,  expanded:true, items:[animalTabs]} ,
      	{title:"Welcome", canCollapse:false,expanded:true, items:[animalMessage6]}
         ]
      });
      
      <%-- fund sections--%>
      isc.SectionStack.create({ID:"animalProfileSections", className:"borderBR",
          visibilityMode:"multiple", backgroundColor:"white",
      	sections:[
          	{ expanded:true, items:[animalMessage2],showHeader:false},
          	{ expanded:true, items:[animalMessage3],showHeader:false}
      	]
      })
      
      <%-- left-side layout--%>
      isc.SectionStack.create({ID:"leftSections",
          showResizeBar:true, visibilityMode:"multiple", width:250, className:"borderBL",
      	sections:[
          	{title:"Left", canCollapse:false, expanded:true, items:[animalProfileSections]}
      	]
      })
      
      <%-- **************overall page layout ************************--%>
      isc.VLayout.create({
      	ID:"pageLayout", 
      	width:"100%", 
      	height:"100%", 
      	members:[
          	animalMessage4,
          	isc.HLayout.create({
          		ID:"mainLayout", 
          		layoutMargin:5, 
          		members:[
              		leftSections,
              		rightSections
          		]
          	})
      	]
      });
      
      function showDetails() {
      
      	var record = nextRecord;
      	if(!rightSections.sectionIsExpanded(2) ){
      	    isc.Timer.setTimeout(
                "rightSections.expandSection(2);",
              0
          	);
      	}
      
         	animalTabs.updateTab(animalTabs.getTabObject("animalGamesTab"),animalGamesSections);
      	animalTabs.updateTab(animalTabs.getTabObject("animalNotesTab"),animalMessage7);
       	animalTabs.updateTab(animalTabs.getTabObject("animalFoodTab"),animalMessage8);
      	animalTabs.updateTab(animalTabs.getTabObject("animalDetailsTab"),animalMessage9);
      
          isc.Timer.setTimeout(
              "animalsGrid.scrollRecordIntoView(" + animalsGrid.getRecordIndex(record) + ")",
              0
          );
      
      }
      
      
      //helper method to copy object properties from one object to another--%>
      function copyObjectProperties(originObj,destObj, dataSourceName){
      	
      	if(destObj==null){
      		destObj={};
      	}
      	var originKeys = isc.getKeys(originObj);
      
      
      	var j = originKeys.length;
      	for (var i = 0; i < j; i++){
      		var key = originKeys[i];
      		//append test to cause value to change
      		destObj[key] = originObj[key] + " test"
      	}
      }
      
      
      function updateGridData(){
      
      		var record = animalsGrid.getRecord(1);
      		record.continent1="test data";
      		record.continent2="test data";
      		record.continent3="test data";
      		record.continent4="test data";
      		record.continent5="test data";
      		record.continent6="test data";
      		record.continent7="test data";
      		record.continent8="test data";
      		record.continent9="test data";
      		record.continent10="test data";
      		record.continent11="test data";
      		record.continent12="test data";
      		record.continent13="test data";
      		record.continent14="test data";
      		record.continent15="test data";
      		record.continent16="test data";
      		record.continent17="test data";
      		record.continent18="test data";
      		record.continent19="test data";
      		record.continent20="test data";
      		record.continent21="test data";
      		record.continent22="test data";
      		record.continent23="test data";
      		record.continent24="test data";
      		record.continent25="test data";
      		record.continent26="test data";
      		record.continent27="test data";
      		record.continent28="test data";
      		record.continent29="test data";
      		record.continent30="test data";
      		record.continent31="test data";
      		record.continent32="test data";
      		record.continent33="test data";
      		record.continent34="test data";
      		record.continent35="test data";
      		record.continent36="test data";
      		record.continent37="test data";
      		record.continent38="test data";
      		record.continent39="test data";
      		record.continent40="test data";
      		record.continent41="test data";
      		record.continent42="test data";
      		record.continent43="test data";
      		record.continent44="test data";
      		record.continent45="test data";
      		record.continent46="test data";
      		record.continent47="test data";
      		record.continent48="test data";
      		record.continent49="test data";
      		record.continent50="test data";
      		record.continent51="test data";
      		record.continent52="test data";
      		record.continent53="test data";
      		record.continent54="test data";
      		record.continent55="test data";
      		record.continent56="test data";
      		record.continent57="test data";
      		record.continent58="test data";
      		record.continent59="test data";
      		record.continent60="test data";
      		record.continent61="test data";
      		record.continent62="test data";
      		record.continent63="test data";
      		record.continent64="test data";
      		record.continent65="test data";
      		record.continent66="test data";
      		record.continent67="test data";
      		record.continent68="test data";
      		record.continent69="test data";
      		record.continent70="test data";
      		record.continent71="test data";
      		record.continent72="test data";
      		record.continent73="test data";
      		record.continent74="test data";
      		record.continent75="test data";
      		record.continent76="test data";
      		record.continent77="test data";
      		record.continent78="test data";
      		record.continent79="test data";
      		record.continent80="test data";
      		record.continent81="test data";
      		record.continent82="test data";
      		record.continent83="test data";
      		record.continent84="test data";
      		record.continent85="test data";
      		record.continent86="test data";
      		record.continent87="test data";
      		record.continent88="test data";
      		record.continent89="test data";
      		record.continent90="test data";
      		record.continent91="test data";
      		record.continent92="test data";
      		record.continent93="test data";
      		record.continent94="test data";
      		record.continent95="test data";
      		record.continent96="test data";
      		record.continent97="test data";
      		record.continent98="test data";
      		record.continent99="test data";
      		record.continent90="test data";
      		record.continent91="test data";
      		record.continent92="test data";
      		record.continent93="test data";
      		record.continent94="test data";
      		record.continent95="test data";
      		record.continent96="test data";
      		record.continent97="test data";
      		record.continent98="test data";
      		record.continent99="test data";
      		record.continent100="test data";
      		record.continent101="test data";
      		record.continent102="test data";
      		record.continent103="test data";
      		record.continent104="test data";
      		record.continent105="test data";
      		record.continent106="test data";
      		record.continent107="test data";
      		record.continent108="test data";
      		record.continent109="test data";
      		record.continent110="test data";
      		record.continent111="test data";
      		record.continent112="test data";
      		record.continent113="test data";
      		record.continent114="test data";
      		record.continent115="test data";
      		record.continent116="test data";
      		record.continent117="test data";
      		record.continent118="test data";
      		record.continent119="test data";
      		record.continent120="test data";
      		record.continent121="test data";
      		record.continent122="test data";
      		record.continent123="test data";
      		record.continent124="test data";
      		record.continent125="test data";
      		record.continent126="test data";
      		record.continent127="test data";
      		record.continent128="test data";
      		record.continent129="test data";
      		record.continent130="test data";
      		record.continent131="test data";
      		record.continent132="test data";
      		record.continent133="test data";
      		record.continent134="test data";
      		record.continent135="test data";
      		record.continent136="test data";
      		record.continent137="test data";
      		record.continent138="test data";
      		record.continent139="test data";
      		record.continent140="test data";
      		record.continent141="test data";
      		record.continent142="test data";
      		record.continent143="test data";
      		record.continent144="test data";
      		record.continent145="test data";
      		record.continent146="test data";
      		record.continent147="test data";
      		record.continent148="test data";
      		record.continent149="test data";
      		record.continent150="test data";
      		record.continent151="test data";
      		record.continent152="test data";
      		record.continent153="test data";
      		record.continent154="test data";
      		record.continent155="test data";
      		record.continent156="test data";
      		record.continent157="test data";
      		record.continent158="test data";
      		record.continent159="test data";
      
      
      		var record2 = isc.clone(record);
      
      		copyObjectProperties(record2,record);
      }
      
      function updateFindAnimalsForm(){
          	findAnimalsForm.setFields(
      		[
          	{type:"staticText", showIf:" return false;",shouldSaveValue:false},
            {name:"search"},
      	{type: "button",  showIf:" return false;",width:200, title:"Ungroup, No Update,  Redraw",click:function(){
      
      		isc.say("redrawing...");
      		if(animalsGrid.isGrouped){
      			animalsGrid.ungroup();
      		}
      		//do not call updateGridData here
      		//updateGridData();
      		animalsGrid.redraw();
      		isc.say('redraw complete');
      		}
      	},
      	{type: "button",  showIf:" return false;",width:200, title:"Ungroup, Update, and Redraw",click:function(){
      
      		isc.say("updating data and redrawing...");
      		if(animalsGrid.isGrouped){
      			animalsGrid.ungroup();
      		}
      		//call updateGridData here which causes
      		updateGridData();
      		animalsGrid.redraw();
      		isc.say('updating data and redraw complete');
      		}
      	},
      	{type: "button", showIf:" return false;", width:200, title:"Group, Update, Redraw",click:function(){
      
      		isc.say("grouping, updating data, and redrawing...");
      		if(!animalsGrid.isGrouped){
      			animalsGrid.groupBy("information");
      		}
      		//call updateGridData here which causes
      		updateGridData();
      		animalsGrid.redraw();
      		isc.say('group, updating data, and redraw complete');
      		}
      	}
      		]
      		);
      
      
      }
      
      function updateAnimalsGrid(){
          animalsGrid.setFields([
      		{name:"commonName"},
                  {name:"scientificName",showIf:"return false;"},
                  {name:"lifeSpan"},
                  {name:"lifeSpan2", formatCellValue:function(value,record,rowNum,colNum){return record.lifeSpan*2;}},
                  {name:"information",showIf:"return false;"},
                  {name:"information2", showIf:"return false;"},
              {name:"continent1", showIf:"return false;"},
              {name:"continent2", showIf:"return false;"},
              {name:"continent3", showIf:"return false;"},
              {name:"continent4", showIf:"return false;"},
              {name:"continent5", showIf:"return false;"},
              {name:"continent6", showIf:"return false;"},
              {name:"continent7", showIf:"return false;"},
              {name:"continent8", showIf:"return false;"},
              {name:"continent9", showIf:"return false;"},
              {name:"continent10", showIf:"return false;"},
              {name:"continent11", showIf:"return false;"},
              {name:"continent12", showIf:"return false;"},
              {name:"continent13", showIf:"return false;"},
              {name:"continent14", showIf:"return false;"},
              {name:"continent15", showIf:"return false;"},
              {name:"continent16", showIf:"return false;"},
              {name:"continent17", showIf:"return false;"},
              {name:"continent18", showIf:"return false;"},
              {name:"continent19", showIf:"return false;"},
              {name:"continent20", showIf:"return false;"},
              {name:"continent21", showIf:"return false;"},
              {name:"continent22", showIf:"return false;"},
              {name:"continent23", showIf:"return false;"},
              {name:"continent24", showIf:"return false;"},
              {name:"continent25", showIf:"return false;"},
              {name:"continent26", showIf:"return false;"},
              {name:"continent27", showIf:"return false;"},
              {name:"continent28", showIf:"return false;"},
              {name:"continent29", showIf:"return false;"},
              {name:"continent30", showIf:"return false;"},
              {name:"continent31", showIf:"return false;"},
              {name:"continent32", showIf:"return false;"},
              {name:"continent33", showIf:"return false;"},
              {name:"continent34", showIf:"return false;"},
              {name:"continent35", showIf:"return false;"},
              {name:"continent36", showIf:"return false;"},
              {name:"continent37", showIf:"return false;"},
              {name:"continent38", showIf:"return false;"},
              {name:"continent39", showIf:"return false;"},
              {name:"continent40", showIf:"return false;"},
              {name:"continent41", showIf:"return false;"},
              {name:"continent42", showIf:"return false;"},
              {name:"continent43", showIf:"return false;"},
              {name:"continent44", showIf:"return false;"},
              {name:"continent45", showIf:"return false;"},
              {name:"continent46", showIf:"return false;"},
              {name:"continent47", showIf:"return false;"},
              {name:"continent48", showIf:"return false;"},
              {name:"continent49", showIf:"return false;"},
              {name:"continent50", showIf:"return false;"},
              {name:"continent51", showIf:"return false;"},
              {name:"continent52", showIf:"return false;"},
              {name:"continent53", showIf:"return false;"},
              {name:"continen534", showIf:"return false;"},
              {name:"continent55", showIf:"return false;"},
              {name:"continent56", showIf:"return false;"},
              {name:"continent57", showIf:"return false;"},
              {name:"continent58", showIf:"return false;"},
              {name:"continent59", showIf:"return false;"},
              {name:"continent60", showIf:"return false;"},
              {name:"continent61", showIf:"return false;"},
              {name:"continent62", showIf:"return false;"},
              {name:"continent63", showIf:"return false;"},
              {name:"continent64", showIf:"return false;"},
              {name:"continent65", showIf:"return false;"},
              {name:"continent66", showIf:"return false;"},
              {name:"continent67", showIf:"return false;"},
              {name:"continent68", showIf:"return false;"},
              {name:"continent69", showIf:"return false;"},
              {name:"continent70", showIf:"return false;"},
              {name:"continent71", showIf:"return false;"},
              {name:"continent72", showIf:"return false;"},
              {name:"continent73", showIf:"return false;"},
              {name:"continent74", showIf:"return false;"},
              {name:"continent75", showIf:"return false;"},
              {name:"continent76", showIf:"return false;"},
              {name:"continent77", showIf:"return false;"},
              {name:"continent78", showIf:"return false;"},
              {name:"continent79", showIf:"return false;"},
              {name:"continent80", showIf:"return false;"},
              {name:"continent81", showIf:"return false;"},
              {name:"continent82", showIf:"return false;"},
              {name:"continent83", showIf:"return false;"},
              {name:"continent84", showIf:"return false;"},
              {name:"continent85", showIf:"return false;"},
              {name:"continent86", showIf:"return false;"},
              {name:"continent87", showIf:"return false;"},
              {name:"continent88", showIf:"return false;"},
              {name:"continent89", showIf:"return false;"},
              {name:"continent90", showIf:"return false;"},
              {name:"continent91", showIf:"return false;"},
              {name:"continent92", showIf:"return false;"},
              {name:"continent93", showIf:"return false;"},
              {name:"continent94", showIf:"return false;"},
              {name:"continent95", showIf:"return false;"},
              {name:"continent96", showIf:"return false;"},
              {name:"continent97", showIf:"return false;"},
              {name:"continent98", showIf:"return false;"},
              {name:"continent99", showIf:"return false;"},
              {name:"continent100", showIf:"return false;"},
              {name:"continent101", showIf:"return false;"},
              {name:"continent102", showIf:"return false;"},
              {name:"continent103", showIf:"return false;"},
              {name:"continent104", showIf:"return false;"},
              {name:"continent105", showIf:"return false;"},
              {name:"continent106", showIf:"return false;"},
              {name:"continent107", showIf:"return false;"},
              {name:"continent108", showIf:"return false;"},
              {name:"continent109", showIf:"return false;"},
              {name:"continent110", showIf:"return false;"},
              {name:"continent111", showIf:"return false;"},
              {name:"continent112", showIf:"return false;"},
              {name:"continent113", showIf:"return false;"},
              {name:"continent114", showIf:"return false;"},
              {name:"continent115", showIf:"return false;"},
              {name:"continent116", showIf:"return false;"},
              {name:"continent117", showIf:"return false;"},
              {name:"continent118", showIf:"return false;"},
              {name:"continent119", showIf:"return false;"},
              {name:"continent120", showIf:"return false;"},
              {name:"continent121", showIf:"return false;"},
              {name:"continent122", showIf:"return false;"},
              {name:"continent123", showIf:"return false;"},
              {name:"continent124", showIf:"return false;"},
              {name:"continent125", showIf:"return false;"},
              {name:"continent126", showIf:"return false;"},
              {name:"continent127", showIf:"return false;"},
              {name:"continent128", showIf:"return false;"},
              {name:"continent129", showIf:"return false;"},
              {name:"continent130", showIf:"return false;"},
              {name:"continent131", showIf:"return false;"},
              {name:"continent132", showIf:"return false;"},
              {name:"continent133", showIf:"return false;"},
              {name:"continent134", showIf:"return false;"},
              {name:"continent135", showIf:"return false;"},
              {name:"continent136", showIf:"return false;"},
              {name:"continent137", showIf:"return false;"},
              {name:"continent138", showIf:"return false;"},
              {name:"continent139", showIf:"return false;"},
              {name:"continent140", showIf:"return false;"},
              {name:"continent141", showIf:"return false;"},
              {name:"continent142", showIf:"return false;"},
              {name:"continent143", showIf:"return false;"},
              {name:"continent144", showIf:"return false;"},
              {name:"continent145", showIf:"return false;"},
              {name:"continent146", showIf:"return false;"},
              {name:"continent147", showIf:"return false;"},
              {name:"continent148", showIf:"return false;"},
              {name:"continent149", showIf:"return false;"},
              {name:"continent150", showIf:"return false;"},
              {name:"continent151", showIf:"return false;"},
              {name:"continent152", showIf:"return false;"},
              {name:"continent153", showIf:"return false;"},
              {name:"continent154", showIf:"return false;"},
              {name:"continent155", showIf:"return false;"},
              {name:"continent156", showIf:"return false;"},
              {name:"continent157", showIf:"return false;"},
              {name:"continent158", showIf:"return false;"},
              {name:"continent159", showIf:"return false;"}
      
      	]
         )
      
      }
      
      function updateQuickAddGrid(){
      
      		quickAddGrid.cancelEditing();
      		quickAddGrid.discardAllEdits();
      		quickAddGrid.markForRedraw();
      
      	    var animalResultSet = isc.ResultSet.create({
      	   		dataSource: animals,
      			initialData: [],
      			criteria: {}
      		});
      		
      		quickAddGrid.setData(animalResultSet); 
      
          quickAddGrid.setFields([
      		{name:"scientificName",required:true},
      		{name:"commonName"},
      		{name:"lifeSpan"},
      	     {name:"status"}
      	]
         )
      
      }
      
        function stripTags(str) {
      	 
      	 
      	if(str!=null && isA.Function(str.split)){
      		//add logic to preserve <br> by converting to \n charcters and then back
      		str=str.replaceAll("<br/>","\n");
      		str=str.replaceAll("&lt;br&gt;", "\n");
      		
      		//convert other representations of open and close tag
      		//to their text equivalents first
      		str=str.replaceAll("&lt;","<");
      		str.replaceAll("&gt;",">");
      		str=str.replaceAll("<","<");
      		str.replaceAll(">",">");
      		str=str.replaceAll("&lt","<");
      		str.replaceAll("&gt",">");
      		str=str.replaceAll("&#60","<");
      		str.replaceAll("&#62",">");
      
      		
      	}
      	
      
      
      	if(str!=null && isA.Function(str.replace)){
      
      		var returnString = str.replace(/<\/?[^>]+>/gi, '');			
      
      		//comment out logic that preserves breaks until iso fixed fixedRecordHeight issue with Firefox
      		//returnString = returnString.replaceAll("\n","<br/>");
      		return returnString;
        	}else{
        		return str;
        	}
        	
        }
      
      function stripDSFields(data,dsFields,deleteNullFields,deleteDisplayOnly, keepExportFieldsOnly){
      
      	//remove any Datasource fields from data object for DSRequest --%>
      	var keys = isc.getKeys(data);
      	var j = keys.length;
      	for (var i = 0; i < j; i++){
      
      		var key = keys[i];
      		var dsField = dsFields[key];
      		
      		//strip out html tags so they don't get into db
      		if(dsField!=null && dsField.type!=null &&  ( dsField.type.toLowerCase()=="text")){
      			var value = isc.getValueForKey(key,data);
      			if(value!=null && value!=key){
      				value = stripTags(value,true);
      				data[key]=value;
      			}
      		}
      		
      
      		
      		//if we are keeping export fields and this is one, continue without removing
      		if(keepExportFieldsOnly){
      			if(dsField!=null && dsField.exportField){
      				continue;
      			}else{
      				delete data[key];
      			}
      		}
      		
      		//delete all fields that are not defined as datasource fields 
      		if((deleteNullFields==null || deleteNullFields) && dsField==null){
      			delete data[key];
      			continue;
      		}
      		
      		//remove any client-side or display only
      		//attributes and any fields that are part of another datasource--%>
      		if(dsField!=null && (isc.DataSource.getDataSource(dsField.type)!=null || ((deleteDisplayOnly==null || deleteDisplayOnly) && dsField.displayOnly))){
      			delete data[key];
      		}
      	}
      	
      	return data;
      	
      
      }
      
      
      function initPageLayout(){
      
          updateAnimalGamesSave()
          updateAnimalGamesSummary();
          updateAnimalGamesEditor();
          updateAnimalDataEditor();
          updateFindAnimalsForm()
          updateAnimalsGrid();
      
        
         pageLayout.draw();
      
         //rightSections.showSection(0); 
         rightSections.showSection(1);
         rightSections.showSection(2);
         rightSections.hideSection(3);
         
         rightSections.collapseSection(2);
      
      	at.initialLayoutComplete=true;
      
         //isc.Timer.setTimeout("animalsGrid.groupBy('information');",4000);
      
      }
      
      
      function initialDataLoad(data,dsRequest){
      
      	createAnimalResultSet(data,dsRequest,data,true);
      
      	initPageLayout();
      }
      
      
      function createAnimalResultSet(data,dsRequest,data,initialLoad){
      
      
      	  var animalResultSet = isc.ResultSet.create({
         		dataSource: animals,
      		initialData: data,
      		criteria: dsRequest.data
      		,neverDropUpdatedRows:true
      		});
      	
      
      	animalsGrid.setData(animalResultSet);
      
      }
      
      animals.fetchData({status:"Threatened"},"initialDataLoad(data,dsRequest);");
      
      
       function formatNumber (anynum, decimal,label,labelPosition,adjustDecimal, divideBy) {
      
      	
      	 if(anynum == null || !isNumber(anynum)){
      		 
      		 	//4/28/11.try to convert to number before failing
      		 	 anynum = Number(anynum);
      		 	 if(!isNumber(anynum)){
      				 return LABEL_NA;		 		 
      		 	 }
      	 }
      
      	   if(divideBy!=null){
      		   anynum = anynum/divideBy;
      	   }
      	 
      	   var divider =10;
      	   switch(decimal){
      			case 0:
      				divider =1;
      				break;
      			case 1:
      				divider =10;
      				break;
      			case 2:
      				divider =100;
      				break;
      			case 3:
      				divider =1000;
      				break;
      			case 4:
      				divider =10000;
      				break;
      			case 5:
      				divider =100000;
      				break;
      			case 6:
      				divider =1000000;
      				break;
      			case 7:
      				divider =10000000;
      				break;
      			case 8:
      				divider =100000000;
      				break;
      			default:  	 //for 3 decimal places--%>
      				divider =1000;
      		}
      
      	   var workNum=Math.abs((Math.round(anynum*divider)/divider));
      
      
      	   
      	   var workStr=""+workNum
      
      	   if (workStr.indexOf(".")==-1){workStr+="."}
      
      	   var dStr=workStr.substr(0,workStr.indexOf("."));
      	   var dNum=dStr-0;
      	   var pStr=workStr.substr(workStr.indexOf("."));
      
             //only fix the decimals if the adjustDecimal param is set to false--%>
              if(adjustDecimal!=null && !adjustDecimal){
      		   while (pStr.length-1< decimal){pStr+="0"}
      		}
      
      	   if(pStr =='.') pStr ='';
      
      	   // Adds a comma in the thousands place.--%>	    
      	   if (dNum>=1000) {
      		  var dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000))+","+dStr.substring(dLen-3,dLen)
      	   }
      
      	   // Adds a comma in the millions place.--%>	   
      	   if (dNum>=1000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000))+","+dStr.substring(dLen-7,dLen)
      	   }
      
      	   // Adds a comma in the billions place--%>
      	   if (dNum>=1000000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000000))+","+dStr.substring(dLen-11,dLen)
      	   }
      
      	   // Adds a comma in the trillions place.--%>
      	   if (dNum>=1000000000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000000000))+","+dStr.substring(dLen-15,dLen)
      	   }
      
      	   if (dNum>=1000000000000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000000000000))+","+dStr.substring(dLen-19,dLen)
      	   }
      
      	   if (dNum>=1000000000000000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000000000000000))+","+dStr.substring(dLen-23,dLen)
      	   }
      
      	   if (dNum>=1000000000000000000000) {
      		  dLen=dStr.length
      		  dStr=parseInt(""+(dNum/1000000000000000000000))+","+dStr.substring(dLen-27,dLen)
      	   }
      	   	   	   	   
      	   var retval = dStr + pStr
      	   
      	if(labelPosition != null && label != null && label!=""){
      		if(labelPosition == "before"){
      			  retval = label + retval;
      		} else {
      			  retval = retval + "&nbsp;" + label;
      		}
      	}
      	
      	// Put numbers in parentheses if negative.--%>
      	if (anynum<0) {
      		retval="("+retval+")";
      	}
      
      	return retval;
       }
      
      function isNumber(value) {
      
          isc.Log.logInfo("typeof value=" + typeof value);
          return typeof value === 'number' && isFinite(value);	
      }
      
      </SCRIPT>
      </BODY></HTML>

      Comment


        #4
        That chartData() call is going to try to chart all fields of the grid except "commonName", including non-numeric values such as "status". If you were trying to plot, say, lifeSpan, pass ["lifeSpan"] as the second argument to chartData().

        Comment


          #5
          I tried changing it like this:
          this.lastChart = this.chartData("commonName",["lifeSpan","lifeSpan2"]);

          And like this:
          this.lastChart = this.chartData("commonName",["lifeSpan"]);

          And like this:
          this.lastChart = this.chartData("commonName","lifeSpan");

          They all still cause the same error with the sample I provided. Am I doing something wrong?

          Comment


            #6
            Well, you have a large amount of unrelated code which is possibly putting bad values in - consider just this:

            Code:
            isc.ListGrid.create({
                ID: "animalList",
                dataSource:"animals",
                autoFetchData:true
            })
            
            isc.Button.create({
                click:function () {
                    animalList.chartData("commonName", ["lifeSpan"]).draw();
                }
            })
            Works as expected (not a pretty chart of course).

            Comment


              #7
              Yes, but the whole point of that rather elaborate sample I posted is that it represents an interpretation of our production application. I've built that rather convoluted sample over time because you need to be able to recreate issues that I see in my application.

              So, it is not surprising that your very simple code works fine. But, it doesn't help me evaluating why I get an error in our application. In order to do that, we'd need to figure out why the sample I sent you is bombing out.

              Do you need me to try to remove as much as possible before re-submitting the sample? Like I mentioned, we are in talks with you guys about a Feature sponsorship related to charting. But, we can't approve that work for you guys until I'm confident that your basic charting functionality is going to work inside of our existing application without massive amounts of rework on our part.

              Comment


                #8
                Yes, please troubleshoot your application code up to the point that you've found something that suggests a framework bug. It doesn't need to be perfectly minimal, but we don't generally dive into a large chunk of application code until there's some reason to believe we have a bug.

                Comment


                  #9
                  Ok, I've isolated the problem to the use of this window property:

                  Code:
                  	isc.Window.addProperties({
                          	autoSize: true
                  	})
                  If you comment out autoSize:true, this problem doesn't happen.

                  Here is the minimized sample showing the problem:

                  Code:
                  <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
                  <HEAD><TITLE>
                          SmartClient SDK - Animal Data Binding example
                  </TITLE>
                  
                  
                  </HEAD><isomorphic:loadISC skin="SmartClient" includeModules="Drawing,Charts"/>
                  <BODY BGCOLOR=#D3D3D3>
                  
                  <SCRIPT>
                  
                  <isomorphic:XML>
                  <jsp:include page="../shared/ds/animals.ds.xml"></jsp:include>
                  </isomorphic:XML>
                  
                  	
                  
                  
                  var at={};
                  
                  isc.setAutoDraw(false);
                  
                  	//autoSize: true on window is the problem
                  	isc.Window.addProperties({
                          	autoSize: true
                  	})
                  
                  var demoApp={};
                  
                  
                  
                  
                  
                  
                  
                  //handles getting the grid's data whether the grid is grouped or ungrouped
                  function getGridDataSet(grid,invalidateCache, useOriginalData, checkIfAllDataLoaded){
                  	
                  	if(grid==null){
                  		return null;
                  	}
                  	
                  	var dataSet=grid.data;
                  	if( ( useOriginalData==null ||useOriginalData) && grid.isGrouped && grid.originalData!=null){
                  		dataSet=grid.originalData;
                  	}
                  	
                  	var dataLoaded = false;
                  	var allDataLoaded=false;
                  	var dataSetLength;
                  
                  	if(grid.isGrouped){
                  		if(grid.originalData!=null){
                  			dataLoaded = isA.Function(grid.originalData.lengthIsKnown) && grid.originalData.lengthIsKnown();
                  			
                  			if(dataLoaded){
                  				//isc.Log.logInfo("in getGridDataSet, checking dataSetLength and rangeIsLoaded on grid.originalData");
                  				dataSetLength = grid.originalData.getLength();
                  				allDataLoaded = isA.Function(grid.originalData.rangeIsLoaded) &&  grid.originalData.rangeIsLoaded(0, dataSetLength);
                  			}
                  		}
                  	}else{
                  		if(grid.data!=null){
                  			dataLoaded = isA.Function(grid.data.lengthIsKnown) && grid.data.lengthIsKnown();
                  			
                  			if(dataLoaded){
                  				//isc.Log.logInfo("in getGridDataSet, checking dataSetLength and rangeIsLoaded on grid.data");
                  				dataSetLength = grid.data.getLength();
                  				allDataLoaded = isA.Function(grid.data.rangeIsLoaded) &&  grid.data.rangeIsLoaded(0, dataSetLength);
                  			}
                  		}
                  	}
                  	
                  
                  	
                  	if(invalidateCache && dataSet!=null && dataSet!=''){
                  
                  
                  		if(allDataLoaded){
                  			
                  			//data is loaded, now we check whether the entire range is loaded to determine
                  			//if we can safely invalidate
                  
                  				if(grid.isGrouped){
                  					//isc.Log.logInfo("in getGridDataSet invalidating cache, calling ungroup");
                  					grid.ungroup();
                  				}
                  				//isc.Log.logInfo("in getGridDataSet, calling invalidateCache");
                  				dataSet.invalidateCache();
                  				//isc.Log.logInfo("in getGridDataSet invalidating cache done");
                  
                  		}
                  		
                  
                  	}
                  	
                  	if((checkIfAllDataLoaded==null || checkIfAllDataLoaded) && !allDataLoaded){
                  		//isc.Log.logInfo("all data not loaded, returning null");
                  		dataSet=null;
                  	}
                  
                  	return dataSet;
                  	
                  }
                  
                  
                  
                  isc.Menu.create({
                  	ID:"animalMenu",
                  	showKeys:true,
                  	data:[
                  		{title:"Add", click:function () {showQuickAddGrid();}},
                  		{title:"Charts", click:function () {showCharts();}}    
                      ]
                  });
                  
                  
                  function showCharts(){
                  
                  		
                  
                  		if(typeof animalChartsContainer=='undefined'){
                  			isc.VLayout.create({
                  			    membersMargin: 10,
                  			    ID: "animalChartsContainer",
                  			    members: [ ]
                  			});
                  		}
                  
                  		animalsGrid.updateChart();
                  		
                  		if(at.chartsWindow==null || !at.chartsWindow.isVisible() || !at.chartsWindow.isDrawn()){
                  
                  	     	at.chartsWindow = isc.Window.create({
                  	            title: "charts 777",
                  	            width:800,
                  	            height:400,
                  	            showResizer:true,
                  	            items: [ animalChartsContainer ]
                  	        });
                  			
                  		}
                  		
                  
                  		
                      	at.chartsWindow.show();
                         	at.chartsWindow.bringToFront();
                  	
                  
                  
                  }
                  
                  ListGrid.create({
                              ID:"animalsGrid",
                      chartType:"Column",
                      updateChart : function (chartType) {
                          // store chart configuration
                          if (chartType) this.chartType = chartType;
                          // or pick up the (possibly changed) chartType from the last chart
                          else if (this.lastChart) this.chartType = this.lastChart.chartType;
                  
                          // if there's already a chart, destroy it
                          if (this.lastChart) this.lastChart.destroy();
                  
                  	isc.Log.logInfo("charting lifepsan!");
                          // generate chart
                          this.lastChart = this.chartData("commonName",["lifeSpan"]);
                          
                          //isc.Log.logInfo("this.lastChart=" + this.lastChart);
                  
                          // show it
                          animalChartsContainer.addMember(this.lastChart, 0);
                  
                      },
                              dataSource:"animals",
                  		canEdit:false,
                              contextMenu:animalMenu,
                  		virtualScrolling:false,
                      		selectionType:"none",
                      		recordClick : function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
                      			nextRecord=record;
                  			showDetails();
                      		}, 
                         	headerHeight: 36
                          })
                  
                  
                  
                  
                  
                  <%-- right-side layout--%>
                  isc.SectionStack.create({
                  	ID:"rightSections", 
                  	overflow:"auto",
                  	className:"borderBR",
                      visibilityMode:"multiple", backgroundColor:"white",
                  	sections:[
                      	{title:"Grid", canCollapse:false, expanded:true, items:[animalsGrid]}
                     ]
                  });
                  
                  
                  
                  
                  
                  <%-- **************overall page layout ************************--%>
                  isc.VLayout.create({
                  	ID:"pageLayout", 
                  	width:"100%", 
                  	height:"100%", 
                  	members:[
                      	isc.HLayout.create({
                      		ID:"mainLayout", 
                      		layoutMargin:5, 
                      		members:[
                          		rightSections
                      		]
                      	})
                  	]
                  });
                  
                  
                  
                  
                  //helper method to copy object properties from one object to another--%>
                  function copyObjectProperties(originObj,destObj, dataSourceName){
                  	
                  	if(destObj==null){
                  		destObj={};
                  	}
                  	var originKeys = isc.getKeys(originObj);
                  
                  
                  	var j = originKeys.length;
                  	for (var i = 0; i < j; i++){
                  		var key = originKeys[i];
                  		//append test to cause value to change
                  		destObj[key] = originObj[key] + " test"
                  	}
                  }
                  
                  
                  function updateGridData(){
                  
                  		var record = animalsGrid.getRecord(1);
                  
                  
                  
                  		var record2 = isc.clone(record);
                  
                  		copyObjectProperties(record2,record);
                  }
                  
                  
                  function updateAnimalsGrid(){
                      animalsGrid.setFields([
                  		{name:"commonName"},
                              {name:"scientificName",showIf:"return false;"},
                              {name:"lifeSpan"},
                              {name:"information",showIf:"return false;"},
                              {name:"information2", showIf:"return false;"}
                  
                  
                  	]
                     )
                  
                  }
                  
                  
                  
                  
                  function initPageLayout(){
                  
                      updateAnimalsGrid();
                  
                    
                     pageLayout.draw();
                  
                     rightSections.showSection(0);
                  
                     
                  
                  	at.initialLayoutComplete=true;
                  
                  
                  }
                  
                  
                  function initialDataLoad(data,dsRequest){
                  
                  	createAnimalResultSet(data,dsRequest,data,true);
                  
                  	initPageLayout();
                  }
                  
                  
                  function createAnimalResultSet(data,dsRequest,data,initialLoad){
                  
                  
                  	  var animalResultSet = isc.ResultSet.create({
                     		dataSource: animals,
                  		initialData: data,
                  		criteria: dsRequest.data
                  		,neverDropUpdatedRows:true
                  		});
                  	
                  
                  	animalsGrid.setData(animalResultSet);
                  
                  }
                  
                  animals.fetchData({status:"Threatened"},"initialDataLoad(data,dsRequest);");
                  
                  
                  
                  </SCRIPT>
                  </BODY></HTML>

                  Comment


                    #10
                    OK, this appears to be happening because the chart is drawn as part of auto-sizing at too small of a size, which causes the warnings you're seeing. But this is apparently only possible as a matter of changing all windows system-wide to be autosizing, which is invalid and would cause many other problems. Don't use that setting, however, do let us know if there's some other way or getting the same problem.

                    Comment


                      #11
                      Ok, that works. I'll change any charting windows to not use autoSize:true. However, we've been using autoSize:true as a system wide property for years with no ill effects so not sure why you are saying that is invalid?

                      Comment


                        #12
                        Because internal framework use of Window will, in various cases, expect that autoSize is off (the default) and rely upon this, and cannot be expected to recapitulate all possible defaults that you might change system-wide.

                        You've probably had a number of subtle cosmetic ill effects from this, or ill effects you didn't realize were connected to this setting and worked around.

                        Comment


                          #13
                          Does it matter that we actually subclass window like this and set this property on the subclass?

                          Code:
                          //properties for custom windows
                          isc.defineClass("ATWindow", "Window").addProperties({
                          		//canDragResize:true,
                          		//showFooter:true,
                          		//showResizer:true,
                          		autoDraw: false,
                                  autoCenter: true,
                                  autoSize: true,
                                  dismissOnEscape: true,
                                  showCloseButton: true,
                                  showMinimizeButton: true
                          	})
                          We only use the ATWindow class for all of our Window objects. Do you still think we probably need to change that?

                          Comment


                            #14
                            That's normal usage. The issue is with changing defaults on framework classes (other than skinning properties).

                            Comment

                            Working...
                            X