:: Forum >>

"Undefined" error when displaying the data

I am trying to display the data inside a <Div> tag, but I get "undefined" error when I say "document.write(obj)"

Help please. Here is the program

HTML Page goes like this
<LINK REL=STYLESHEET TYPE="text/css" HREF="/RGA_New/css/Royal.css">
<link href="/RGA_New/runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<SCRIPT LANGUAGE="JavaScript" SRC="/RGA_New/js/RoyalCommon.js"></SCRIPT>
<script src="/RGA_New/source/lib/grid.js"></script>
<script src="/RGA_New/runtime/lib/paging1.js"></script>
.active-controls-grid {width: 900; height: 500; font: menu; background-color: #FFFFFF;}
.active-column-0 {width: 50px;}
.active-column-1 {width: 80px;}
.active-column-2 {width: 150px;}
.active-column-3 {width: 150px;}
.active-column-4 {width: 50px;}
.active-column-5 {width: 180px;}
.active-column-6 {width: 80px;}
.active-column-7 {width: 80px;}
.active-column-0 {text-align: left;}
.active-column-1 {text-align: left;}
.active-column-2 {text-align: left;}
.active-column-3 {text-align: left;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: left;}
.active-column-6 {text-align: left;}
.active-column-7 {text-align: left;}
.active-grid-column {border-right: 1px solid threedlightshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow; height: 20px;}
<TR><TD CLASS="Label">Repair&nbsp;Quote#:</TD>
<TD CLASS="Label"><INPUT FORMNAME="REPAIR" CLASS="Text" TYPE=TEXT ID="logid1" SIZE=20 NODISABLE='Y'>&nbsp;&nbsp;<img src="/RGA_New/imgs/ico_go.gif" border=0 onclick="javascript:Form_FetchData(document.all.logid.value);"></TD></TR>
<DIV id="GridDiv">
<div id="divGrid"></div>
<SCRIPT LANGUAGE="JavaScript" SRC="/RGA_New/js/Repair.js"></SCRIPT>
And then Repair.js file
[code]var objRepair="";
function Form_Load() {
try {

} catch(e) {
alert("Repair.js:Form_Load - Error: (" + e.description + ")");

function Form_FetchData(id) {
try {
    var list_columns=["Quote#","Date","Name","Comments","Qty","Quote Type","Quote Date","Status"];

objRepair = new Active.Controls.Grid;
     objRepair.setColumnProperty("count", 8);
     objRepair.setColumnProperty("text", function(i){return list_columns[i]});

     var i=0;
     var url="/RGA_New/xml/Listdata.asp?sid=" + Math.random();
var result=GetXMLData(url);
     var sdata = result.split("|");
     objRepair.setRowProperty("count", sdata[0]);
     var list_data=sdata[1];
objRepair.setDataProperty("text", function(i, j){return list_data[i][j]});
     document.all.divGrid.innerHTML = objRepair;
} catch(e) {
alert("Repair.js::DataRequest - Error: (" + e.description + ")");

function create_gridobj() {

window.onload = Form_Load;


In js file in Form_FetchData function, I am creating the Grid object and setting the attributes and doing a document.write(objRepair), I get "undefined" error.

Please help me.

Wednesday, March 15, 2006
What i am doing is:

objRepair = new AW.UI.Grid;

Viren Dholakia
Friday, March 17, 2006

This topic is archived.

Back to support forum

Forum search