:: Forum >>

Error on controls nested in AW.HTML.TABLE

I am testing AW.HTML.TABLE and found an error. I nested a grid into a table. When I click the grid, my browser's status bar shows "Error on page". The following is my test code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<link href="../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../runtime/lib/aw.js"></script>

</head>
<body>
<form id="form1" runat="server">
<script>
var grid=new AW.UI.Grid;
grid.setHeaderText(["test1","test2"]);
grid.setColumnCount(2);
grid.setRowCount(1);
var table = new AW.HTML.TABLE;
var row = new AW.HTML.TR;
var cell = new AW.HTML.TD;
cell.setContent("html", grid);
row.setContent("cell1", cell);
table.setContent("row", row);
document.write(table);
</script>
</form>
</body>
</html>
mrhsh
Wednesday, April 30, 2008
Here is another error I met. If I nest the above table into a group, the grid cells is not accesable. I just replace the last code "document.write(table);" with the following code to nest the table into the group:

var grp=new AW.UI.Group;
grp.setControlSize(200, 300);
grp.setControlText("Info");
grp.setContent("table",table);
document.write(grp);

Is that a bug or I missed something?

Thanks,
mrhsh
Wednesday, April 30, 2008
http://www.activewidgets.com/javascript.forum.14552.4/ie-runtime-error-on-aw.html
Thursday, May 1, 2008
That example couldn't give me any clue how to fix the problems I stated above. My problems are:

1. Controls nested in AW.HTML.TABLE can be accessible but with errors. If you click any controls in the TABLE, browser will throw an error into the status bar.

2. Controls nested in AW.UI.Group can't be accessible at all. You can't type anything into an AW Input if it is nested in a Group.

Could you run my code above, and see the problem?

Thanks,
mrhsh
Thursday, May 1, 2008
setContent() method allows to insert other html elements, but not AW controls, such as grid, tabs, combo etc. This method is intended for assembling the controls themselves. Unfortunately it does not work for assembling the forms or applications out of the AW controls.
Alex (ActiveWidgets)
Thursday, May 1, 2008
So, how can I make layout for my page with many controls. For example, I like to make 2 AW grids side-by-side and 2 AW buttons between these 2 grids, one button at top-alignment, and another button at bottom-alignment. Is it easy to make this layout without Table? Please give me a sample code.

Thanks,
mrhsh
Thursday, May 1, 2008
Not sure about it's use inside 'forms', but..
It seems that appending toString in this case avoids the mentioned message. ( based on msg line # , isn't a focus issue ? )
cell.setContent("html", grid.toString() );
Hopping could be that simple :-/
Carlos
Thursday, May 1, 2008
Yes. I just replaced

cell.setContent("html", grid);

with

cell.setContent("html", grid.toString() );

It Eliminated the error message.

However, the 2nd problem is still there. If I nest the above table into a group, the grid cells is not accesable. You can't type anything into the grid's cell (I set the grid ediable for all cells). Any clue?

Thank you very much!
mrhsh
Thursday, May 1, 2008
Well, I tested some more about table contents, and (as Alex said) there are interferences inserting more than a sigle AW control ( especially focusing and scrolling )

About group, it seems to be similar behaivours, please check:
http://www.activewidgets.com/javascript.forum.22400.4/how-to-add-mutie-object.html

http://www.activewidgets.com/javascript.forum.10768.8/newbie-adding-grid-inside-a.html

Or try searching the forum for 'group' to get more info.
HTH
Carlos
Thursday, May 1, 2008
So, there is no a satisfied way to make a complicated page layout yet. Right?

I used to use asp.net html table control to layout pages and nest any controls including AW controls in the asp.net html table. It works fine until I tried AW.UI.Tabs. I found no way to nest asp.net html tables into AW.UI.Tabs. I hope this feature can be included in your next update soon.

Thanks again!
mrhsh
Thursday, May 1, 2008

This topic is archived.


Back to support forum

Forum search