:: Forum >>

"Undefined" error when displaying the data

Hi
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
=====================================================
<html>
<head><title></title>
<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>
<style>
.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;}
</style>
</head>
<body>
<TABLE>
<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>
</TABLE><BR>
<DIV id="GridDiv">
<div id="divGrid"></div>
</DIV>
<SCRIPT LANGUAGE="JavaScript" SRC="/RGA_New/js/Repair.js"></SCRIPT>
</body>
</html>
=====================================================
And then Repair.js file
=====================================================
[code]var objRepair="";
function Form_Load() {
try {
    
//create_gridobj()
Form_FetchData();

} 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;
     document.write(objRepair);
} catch(e) {
alert("Repair.js::DataRequest - Error: (" + e.description + ")");
}
}

function create_gridobj() {
    //objRepair.setId("G1");
}

window.onload = Form_Load;

=====================================================[/code]

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.

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

objRepair = new AW.UI.Grid;

.
.
.
.
.
document.write(objRepair);
Viren Dholakia
Friday, March 17, 2006

This topic is archived.


Back to support forum

Forum search