:: Forum >>

Please Help: "undefined is null or not an object" (IE)

I am trying to run this in a portlet, hence the funny naming. It works fine in firefox, but in IE produces the error "undefined is null or not an object"

The code is

<div align="center" id="div_grid__PositionsByDirection_WAR_chartwriter_" style="width:100%; overflow:auto;">
grid_grid__PositionsByDirection_WAR_chartwriter__data =[
[ "NORTH","1" ]
,[ "SOUTH","2" ]
,[ "EAST","3" ]
,[ "WEST","4" ]
var grid_grid__PositionsByDirection_WAR_chartwriter__columns = [
var grid_grid__PositionsByDirection_WAR_chartwriter__columnsSentIn = [
//initialzie the grid
var grid__PositionsByDirection_WAR_chartwriter_ = new AW.UI.Grid;
grid__PositionsByDirection_WAR_chartwriter_.setStyle('width', '100%');
grid_grid__PositionsByDirection_WAR_chartwriter__dataArray = eval(grid_grid__PositionsByDirection_WAR_chartwriter__data);
if (grid_grid__PositionsByDirection_WAR_chartwriter__dataArray.length < 100) {
} else {
grid__PositionsByDirection_WAR_chartwriter_.setEvent("onselectstart", "");
<script language="javascript">
// document.getElementById("a_PositionsByDirection_WAR_chartwriter_tableDiv").innerHTML = a_PositionsByDirection_WAR_chartwriter_grid;

I tried using MicroSoft Script Debugger, it breaks on aw.js line 16 "if(obj["_"+parts[i]+"Content"])", obj is null.

Please Help!!
Sunday, April 8, 2007
After digging a bit, we found that this is happening when we are importing the aw.js in multiple portlets. When we import it only once per portal page it works.

We should be able to import it multiple times. Please advise
Sunday, April 8, 2007
If you include aw.js multiple times it is definitely wrong - aw.js and aw.css should be included once, preferably into the HEAD section. I believe most portals allow to configure the resource files to be loaded just once instead of in each portlet. In the worst case just wrap the content of aw.js in IF(){} statement -

if (!window.AW) {
// content of aw.js here

There might be another problem in your code - you put the grid into the page twice, once with <div id="grid"></div> and grid.refresh(); and then the second time with document.write(grid) statement. This might also trigger the similar error. The code assumes unique id for each AW element.
Alex (ActiveWidgets)
Tuesday, April 10, 2007

This topic is archived.

Back to support forum

Forum search