3.2.0

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>

shasi
November 17,
relplace "Active" with "aw" in your code, i hope this will work.
jal
November 17,
thanks
i included grid.js file and its working
but my grid is not showing up plz help i dont no where im wrong

i need to put by today afternoon

MY CODE

<html>
<style>
#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;
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>
<script language = "javascript" src = "grid.js">

// **** 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 myColsTips5 = ["Id","UserName", "Password","Authecation scheme","first Name","Last Name","Phone","Email","Status"];
var vs_currElement5=0;
var vs_Count5 = myData.length

obj.setId("grid5");
var dvobj = document.getElementById("usertab");

obj5.setRowProperty("count", vs_Count5);
obj5.setColumnProperty("count", myColumns.length);
obj5.setDataProperty("text", function(i, j)
{
var retval = myData5[i+vs_currElement5][j];
var return retval;
});

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");

obj.setStatusProperty("text", function()
{
switch(this.getStatusProperty("code"))
{
case "loading":
return "Loading TABLE";
case "nodata":
return "No TABLE Found.";
default:
return "";
}
});



dvobj.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)
{
alert("XmlHttp not done" + e1);
}
}
}


function userList()
{
var url="url here"

var tmp = "the request file"
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++)
{
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>

<div id="usertab" height="200px" style="width:100%;">Loading TABLES...</div>

</html>

shasi
November 17,
Hmmm.... ???
#grid5 .active-controls-grid {height: 100%; ......
instead of:
#grid5{width:100%; height: 250px;.......
November 17,

This topic is archived.

See also:


Back to support forum