:: Forum >>

Whats wrong in my XML Table?

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="js/aw.js"></script>
<script src="js/specialArray.js"></script>
<link href="css/xp/grid.css" rel="stylesheet"></link>
    <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

    <!-- ActiveWidgets stylesheet and scripts -->
    <link href="css/xp/grid.css" rel="stylesheet" type="text/css" ></link>

    <!-- grid format -->
    <style>
        .active-controls-grid {height: 100%; font: menu;}

        .active-column-0 {width: 80px;}
        .active-column-1 {width: 200px; background-color: threedlightshadow;}
        .active-column-2 {text-align: right;}
        .active-column-3 {text-align: right;}
        .active-column-4 {text-align: right;}
        .active-column-5 {text-align: right;}

        .active-grid-column {border-right: 1px solid threedshadow;}
        .active-grid-row {border-bottom: 1px solid threedlightshadow;}
    
</style>
</head>

<body>
    <script>

    // create data formats
var r = new AW.HTTP.Request;
r.setURL("http://localhost:8080/webservice/ws");
r.setRequestMethod("POST");
r.setParameter("op", 1);
        
        var table = new AW.XML.Table;

        var codigo = new AW.Formats.Number;
        var descricao = new AW.Formats.String;
        
        // define formatting rule for text output
        codigo.setTextFormat("");
        
        // set var columns XPath
        var columnNodes = ["codigo", "descricao"];
        
        r.response = function(text){
            table.setRows("//NewDataSet/*");
            // set columns XPath
            table.setColumns(columnNodes);
            table.response(text);
        };
        
        // send the request (async)
        r.request();
        
        var obj = new AW.UI.Grid;
        obj.setCellModel(table);
        obj.setCellFormat([codigo, descricao]);
        obj.setColumnProperty("texts", columnNodes);
        document.write(obj);
</script>
...
...
...


XML Code:
<noticias>
<noticia>
<codigo>xx</codigo>
<descricao>yy</descricao>
</noticia>
</noticias>

Error in line 31, caracter: 3761
U guys see the problem? Tankz.
pc
Friday, March 10, 2006
anyone can help me pelase?
i got the xml in client side, but some error when trying to show table.
pc
Monday, March 13, 2006
It looks like you have a mix of v1.0 code (css) and v2.0 code. I suggest starting clean with the xml example in /examples/old/xml-simple.htm.
Alex (ActiveWidgets)
Monday, March 13, 2006
table.setRows("//NewDataSet/*");
I believe that should refer to xml that starts with

<NewDataSet>

</NewDataSet>


don't you want

table.setRows("//noticias/noticia/*");

or something?
Dave Brown
Monday, March 13, 2006
table.setRows("//noticias/noticia/*");

Tkz for this... about the mix versions, i need use POST METHOD to get xml, the examples/old/xml - simple.htm dont hav it, how can use post method?
pc
Monday, March 13, 2006
anyone can help me please?
pc
Wednesday, March 15, 2006
Save your XML as static file, copy /examples/old/xml-simple.htm and make sure it works, then move everything to the webserver.

setRequestMethod("POST") works in 2.0 same as 1.0
Alex (ActiveWidgets)
Wednesday, March 15, 2006

This topic is archived.


Back to support forum

Forum search