Object Undefined when loading page or selecting checkbox
Hello,
I have a grid setup, when the page is loaded I get an error message that says "Object Doesn't Support this Property or Method" and ties to the bolded line below. After I click ok the grid loads, but if I click on the checkbox or try to scroll down I continue to get the same message.
AW.dispatch=function(element,event)
{
var type="_on"+(events[event.type] || event.type)+"Event";
var target=AW.object(element.id);
var obj=target;
while(obj._parent)
{
obj=obj._parent
}
return target[type].call(obj,event)
};
Chris
November 8,
Forgot to mention, this is in aw.js
Chris
November 8,
Anybody... there is probably something simple I need to set but I've stared at this so long right now I am lost. I am dead in the water.
Chris
November 9,
Difficult to say, I guess it could happen if you
- change object id after writing it to the page (?)
- use '-' character in object id
Alex (ActiveWidgets)
November 9,
This is what the javascript looks like:
function loadPage()
{
var div = document.getElementById("test");
var rawData = searchForm.elements['property(tableData)'].value;
var dataSerializer = new ArraySerializer(12, new Array());
var tableData = dataSerializer.deserialize(rawData);
var rawColumns = searchForm.elements['property(normalColumns)'].value;
var columns = dataSerializer.deserialize(rawColumns);
// create grid object
var obj = new AW.UI.Grid;
// assign cells and headers text
obj.setCellText(tableData);
obj.setHeaderText(columns);
// set number of columns/rows
obj.setColumnCount(12);//searchForm.elements['property(columnCount)'].value);
obj.setRowCount(250);//searchForm.elements['property(rowCount)'].value);
obj.setCellTemplate(new AW.Templates.Checkbox, 0);
// set initial value for column 2
obj.setCellValue(true, 0);
obj.setStyle('width', '100%');
div.innerHTML = obj;
}
That's all I am doing right now. This is being done outside of the JSP in a seperate Javascript file.
Chris
November 9,
Chris,
I cannot reproduce this, here is the code I tried -
<div id="test"></div>
<script>
function loadPage()
{
var div = document.getElementById("test");
var obj = new AW.UI.Grid;
obj.setCellText("cell");
obj.setHeaderText("header");
obj.setColumnCount(12);
obj.setRowCount(250);
obj.setCellTemplate(new AW.Templates.Checkbox, 0);
obj.setCellValue(true, 0);
obj.setStyle('width', '100%');
div.innerHTML = obj;
}
window.setTimeout(loadPage, 1000);
</script>
Alex (ActiveWidgets)
November 9,
We have a heavily modified struts framework sitting around everything, I am worried this is causing the problem. Unfortunetly I took what I had and put it into dumb HTML and it worked fine.
I'll have to keep fiddling.
Thanks.
Chris
November 9,