:: Forum >>
AJAX with combo box
Hi,
I want to use the XML.table to dynamically update the items of the combo box. But setting the setItemModel to the XMLTable causes a exception, because there is some code behind in default response() behavior for clearing the grid.
Hence I've overwritten the response method and added my own update of the combo (see below).
But maybe somebody knows an easier or more comfortable way to achieve this functionality in that I want to upate some more widgets dynamically.
var xmlTable = new AW.XML.Table;
xmlTable.setURL(xmlURL);
xmlTable.setParameter('paramid', 'paramValue');
xmlTable.response = function(xml)
{
this.setXML(xml);
var items = new Array()
for (i=0; i<this.getCount(); ++i)
{items[i] = this.getData(0,i);}
combo.clearSelectedModel();
combo.clearCurrentModel();
combo.setItemCount(this.getCount());
combo.setItemText(items);
combo.refresh();
};
xmlTable.request();
var combo = new AW.UI.Combo;
combo.setId("combo");
combo.setItemModel(xmlTable);
heis
Thursday, September 14, 2006
This topic is archived.
Back to support forum
Forum search