:: Forum >> Version 2 >>

Whats wrong in my XML Table?

More information on this topic is available in the documentation section: /aw.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
    <
stylebodyhtml {margin:0pxpadding0pxoverflowhidden;} </style>

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

    <!-- 
grid format -->
    <
style>
        .
active-controls-grid {height100%; fontmenu;}

        .
active-column-{width:  80px;}
        .
active-column-{width200pxbackground-colorthreedlightshadow;}
        .
active-column-{text-alignright;}
        .
active-column-{text-alignright;}
        .
active-column-{text-alignright;}
        .
active-column-{text-alignright;}

        .
active-grid-column {border-right1px solid threedshadow;}
        .
active-grid-row {border-bottom1px solid threedlightshadow;}
    </
style>
</
head>

<
body>
    <
script>

    
//    create data formats
        
var = 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([codigodescricao]);
        
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 /aw.xml.table/

Documentation:

Forum search