3.2.0

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
September 14,

This topic is archived.

See also:


Back to support forum