:: Forum >>

Bug using AW.UI.Link in AW.Panels.Horizontal ?

Hi,

Just ran into something that might be a bug.
In the code below, I use a link inside a bottom horizontal panel.
It works fine in Firefox and follows the link.
However, in IE7, it produces a javascript error "Error: 'undefined' is null or not an object" and doesn't follow the link.
I tried it using both AW 2.0.2 and 2.0.1 - same result.
In IE6, it gives an error but follows the link.

Is this a bug or is there something wrong with my code ?

Thanks,
Ankur

<html>
<head>

<script src="activewidgets/runtime/lib/aw.js"></script>
<link href="activewidgets/runtime/styles/xp/aw.css" rel="stylesheet"></link>

</head>
<body>
<script>

var obj = new AW.Grid.Extended;

var myColumns = [
    "A", "B", "C", "D", "E", "F"
];

obj.setCellText(function(i, j){return j + "-" + i});

obj.setHeaderText(myColumns);

obj.setRowCount(10);
obj.setColumnCount(6);

var toolbar = new AW.HTML.DIV;
toolbar.setId("toolbar");

var temp = new AW.HTML.SPAN;

var link = new AW.UI.Link;
link.setControlText("the link");
link.setControlLink("http://www.google.com");
temp.setContent("theSpan", link);

toolbar.setContent("temp", temp);

obj.defineTemplate("bottomLine", toolbar);

obj.setLayoutTemplate(new AW.Panels.Horizontal);
obj.setPanelTemplate(function(i){
switch(i){
case 1: return this.getScrollTemplate();
case 2: return this.getBottomLineTemplate();
}
});

obj.setPanelHeight(23, 2); //bottom line

document.write(obj);

</script>
</body>
</html>
Ankur Motreja
Monday, August 6, 2007
Hi Ankur,
Have you checked post # 13500 ?
If this is the same "issue", just need to replace:
toolbar.setContent("temp", temp);
with:
toolbar.setContent("temp", function(){return temp});
Pls reply if it works ( AS I don't have now all the browsers to test it).
HTH
Carlos
Monday, August 6, 2007
Hi Carlos,

Thanks !! That did it.
Changing both temp.setContent() and toolbar.setContent() to the format you mentioned fixed the issue.

Thanks,
Ankur
Ankur Motreja
Monday, August 6, 2007

This topic is archived.


Back to support forum

Forum search