<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>
...
...
...
<noticias>
<noticia>
<codigo>xx</codigo>
<descricao>yy</descricao>
</noticia>
</noticias>
table.setRows("//NewDataSet/*");
<NewDataSet>
</NewDataSet>
table.setRows("//noticias/noticia/*");
table.setRows("//noticias/noticia/*");
This topic is archived.