Active is undefined--- URGENT
Hi,
I try to display a grid in a html page. but when i run the page the error os
Active is undefined. its exactly i have created the object.
Help needed Urgent i need to show the work by today.
My code
<html>
#grid5
{
width:100%; height: 250px;
background: white;
font-family: Verdana,Arial,Sans-serif,'Times New Roman';
font-size: 8pt;
font-weight: normal;
font-style: normal;
vertical-align: middle;
align:left;
border-top: 0px;
border-right: 1px #E6E6E6 solid;
border-bottom: 1px #E6E6E6 solid;
border-left: 1px #E6E6E6 solid;
overflow:auto;
}
#grid5 .active-column-0 {text-align:left;width: 130px;}
#grid5 .active-column-1 {text-align:left;width: 120px;}
#grid5 .active-column-2 {text-align:left;width: 90px;display:none;}
#grid5 .active-column-3 {text-align:left;width: 90px;display:none;}
#grid5 .active-column-4 {text-align:left;width: 120px;}
#grid5 .active-column-5 {text-align:center;width: 90px;}
#grid5 .active-column-6 {text-align:center;width: 60px;}
#grid5 .active-column-7 {text-align:center;width: 110px;}
#grid5 .active-column-8 {text-align:center;width: 60px;display:none;}
#grid5 .active-column-9 {text-align:center;width: 0px;display:none;}
.active-header-over
{
border-color: #cbc7b8;
background: #d6d2c2!important;
}
.active-header-over .active-box-item
{
border-color: #e2decd;
background: #ebeadb;
}
.active-grid-column
{
border-right: 1px solid threedlightshadow;
border-color: #ededed;
}
</style>
// **** Grid for showing TABLE
var obj = new Active.Controls.Grid;
var myData = new Array;
function showGrid()
{
var x =0;
var myColumns = ["Id","UserName", "Password","Authecation scheme","first Name","Last Name","Phone","Email","Status"];
var rwCount = myData.length;
//obj.setId("grid5");
obj.setRowProperty("count", rwCount);
obj.setColumnProperty("count", myColumns.length);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
/*{
var retval = myData[i][j];
});*/
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.defineSortProperty("index",0);
obj.defineSortProperty("rowcount",myData.length);
obj.defineSortProperty("direction","ascending");
obj.setRowHeaderWidth("0px");
obj.setColumnHeaderHeight("17px");
//$('ddns_rowid').value = this.getProperty("selection/index");
//dvobj.innerHTML = obj;
getElementById("listtab").innerHTML = obj;
}
var xmlHttp = null;
if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest()
}
else
{
try
{
xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e1)
{
xmlHttp = false;
}
}
}
function userList()
{
var url="the url goes here";
var tmp = " the xml request file goes here"
xmlHttp.open("POST", url , true);
xmlHttp.onreadystatechange = pageLoad;
xmlHttp.setRequestHeader("Man","POST / HTTP 1.1")
xmlHttp.setRequestHeader("Content-Type","text/xml")
xmlHttp.send(tmp);
}
function pageLoad()
{
if (xmlHttp.readyState == 4)
{
var response = xmlHttp.responseText;
var doc = xmlHttp.responseXml;
//alert(response);
var xmlhost = doc.selectNodes("//objmfe:list-usersResponse/list/item")
var myData = new Array;
myData = [];
//alert(xmlhost.length);
/*
for(var i = 0;i<=xmlhost.length;i++)
{
alert(i)
}
*/
for(var i = 0;i<xmlhost.length;i++)
{
var xmluser = xmlhost[i]
alert(xmluser);
if(xmluser.selectSingleNode("id/text()"))
{
var userid = xmluser.selectSingleNode("id/text()").nodeValue;
// alert(userid)
}
if (xmluser.selectSingleNode("username/text()"))
{
var user = xmluser.selectSingleNode("username/text()").nodeValue;
}
if (xmluser.selectSingleNode("password/text()"))
{
var pwd = xmluser.selectSingleNode("password/text()").nodeValue;
}
if (xmluser.selectSingleNode("auth-scheme/text()"))
{
var scheme = xmluser.selectSingleNode("auth-scheme/text()").nodeValue;
}
if (xmluser.selectSingleNode("first-name/text()"))
{
var fname = xmluser.selectSingleNode("first-name/text()").nodeValue;
}
if (xmluser.selectSingleNode("last-name/text()"))
{
var lname = xmluser.selectSingleNode("last-name/text()").nodeValue;
}
if (xmluser.selectSingleNode("pri-phone/text()"))
{
var pphone = xmluser.selectSingleNode("pri-phone/text()").nodeValue;
}
if (xmluser.selectSingleNode("email/text()"))
{
var e_mail = xmluser.selectSingleNode("email/text()").nodeValue;
}
if (xmluser.selectSingleNode("status/text()"))
{
var stat = xmluser.selectSingleNode("status/text()").nodeValue;
//alert(stat);
}
}
myData[i] = "[\""+
userid+"\"," + "\""+
user+"\"," + "\""+
pwd+"\"," + "\""+
scheme+"\"," + "\""+
fname+"\"," + "\""+
lname+"\"," + "\""+
pphone+"\"," + "\""+
e_mail+"\"," + "\""+
stat+"\"," + "\""+
"\"]";
myData = eval("["+myData+"]");
}
showGrid();
}
userList();
</script>
<table>
<tr>
<td>
<div id="listtab" style="width:100%;"></div>
</td>
</tr>
</table>
</html>
I try to display a grid in a html page. but when i run the page the error os
Active is undefined. its exactly i have created the object.
Help needed Urgent i need to show the work by today.
My code
<html>
#grid5
{
width:100%; height: 250px;
background: white;
font-family: Verdana,Arial,Sans-serif,'Times New Roman';
font-size: 8pt;
font-weight: normal;
font-style: normal;
vertical-align: middle;
align:left;
border-top: 0px;
border-right: 1px #E6E6E6 solid;
border-bottom: 1px #E6E6E6 solid;
border-left: 1px #E6E6E6 solid;
overflow:auto;
}
#grid5 .active-column-0 {text-align:left;width: 130px;}
#grid5 .active-column-1 {text-align:left;width: 120px;}
#grid5 .active-column-2 {text-align:left;width: 90px;display:none;}
#grid5 .active-column-3 {text-align:left;width: 90px;display:none;}
#grid5 .active-column-4 {text-align:left;width: 120px;}
#grid5 .active-column-5 {text-align:center;width: 90px;}
#grid5 .active-column-6 {text-align:center;width: 60px;}
#grid5 .active-column-7 {text-align:center;width: 110px;}
#grid5 .active-column-8 {text-align:center;width: 60px;display:none;}
#grid5 .active-column-9 {text-align:center;width: 0px;display:none;}
.active-header-over
{
border-color: #cbc7b8;
background: #d6d2c2!important;
}
.active-header-over .active-box-item
{
border-color: #e2decd;
background: #ebeadb;
}
.active-grid-column
{
border-right: 1px solid threedlightshadow;
border-color: #ededed;
}
</style>
// **** Grid for showing TABLE
var obj = new Active.Controls.Grid;
var myData = new Array;
function showGrid()
{
var x =0;
var myColumns = ["Id","UserName", "Password","Authecation scheme","first Name","Last Name","Phone","Email","Status"];
var rwCount = myData.length;
//obj.setId("grid5");
obj.setRowProperty("count", rwCount);
obj.setColumnProperty("count", myColumns.length);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
/*{
var retval = myData[i][j];
});*/
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.defineSortProperty("index",0);
obj.defineSortProperty("rowcount",myData.length);
obj.defineSortProperty("direction","ascending");
obj.setRowHeaderWidth("0px");
obj.setColumnHeaderHeight("17px");
//$('ddns_rowid').value = this.getProperty("selection/index");
//dvobj.innerHTML = obj;
getElementById("listtab").innerHTML = obj;
}
var xmlHttp = null;
if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest()
}
else
{
try
{
xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e1)
{
xmlHttp = false;
}
}
}
function userList()
{
var url="the url goes here";
var tmp = " the xml request file goes here"
xmlHttp.open("POST", url , true);
xmlHttp.onreadystatechange = pageLoad;
xmlHttp.setRequestHeader("Man","POST / HTTP 1.1")
xmlHttp.setRequestHeader("Content-Type","text/xml")
xmlHttp.send(tmp);
}
function pageLoad()
{
if (xmlHttp.readyState == 4)
{
var response = xmlHttp.responseText;
var doc = xmlHttp.responseXml;
//alert(response);
var xmlhost = doc.selectNodes("//objmfe:list-usersResponse/list/item")
var myData = new Array;
myData = [];
//alert(xmlhost.length);
/*
for(var i = 0;i<=xmlhost.length;i++)
{
alert(i)
}
*/
for(var i = 0;i<xmlhost.length;i++)
{
var xmluser = xmlhost[i]
alert(xmluser);
if(xmluser.selectSingleNode("id/text()"))
{
var userid = xmluser.selectSingleNode("id/text()").nodeValue;
// alert(userid)
}
if (xmluser.selectSingleNode("username/text()"))
{
var user = xmluser.selectSingleNode("username/text()").nodeValue;
}
if (xmluser.selectSingleNode("password/text()"))
{
var pwd = xmluser.selectSingleNode("password/text()").nodeValue;
}
if (xmluser.selectSingleNode("auth-scheme/text()"))
{
var scheme = xmluser.selectSingleNode("auth-scheme/text()").nodeValue;
}
if (xmluser.selectSingleNode("first-name/text()"))
{
var fname = xmluser.selectSingleNode("first-name/text()").nodeValue;
}
if (xmluser.selectSingleNode("last-name/text()"))
{
var lname = xmluser.selectSingleNode("last-name/text()").nodeValue;
}
if (xmluser.selectSingleNode("pri-phone/text()"))
{
var pphone = xmluser.selectSingleNode("pri-phone/text()").nodeValue;
}
if (xmluser.selectSingleNode("email/text()"))
{
var e_mail = xmluser.selectSingleNode("email/text()").nodeValue;
}
if (xmluser.selectSingleNode("status/text()"))
{
var stat = xmluser.selectSingleNode("status/text()").nodeValue;
//alert(stat);
}
}
myData[i] = "[\""+
userid+"\"," + "\""+
user+"\"," + "\""+
pwd+"\"," + "\""+
scheme+"\"," + "\""+
fname+"\"," + "\""+
lname+"\"," + "\""+
pphone+"\"," + "\""+
e_mail+"\"," + "\""+
stat+"\"," + "\""+
"\"]";
myData = eval("["+myData+"]");
}
showGrid();
}
userList();
</script>
<table>
<tr>
<td>
<div id="listtab" style="width:100%;"></div>
</td>
</tr>
</table>
</html>
shasi
November 17,