3.2.0

Combo setControlText() and onControlTextChanged()

Hi,
I use two Combo controls (AW.UI.Combo ). I pre-populate the first combo (hard-coded values). When I select any item (using onControlTextChanged() method) in the first combo, it makes a XML request (AW.XML.Table) and populates the second combo. This works fine.

But I also use setControlText() method on the first combo to set the current configuration of a product, which in turn triggers the onControlTextChanged() method on the first combo, which again makes a XML request for the second combo and populates again.

This was just an example, if I am using setControlText() on number of Combos, then the performance is greatly affected, as it makes redundant xml calls.

Is there any other method I can use instead of onControlTextChanged(), so that it does not trigger the xml call for the second (consecutive times)? or Is there any other method I can use for this problem.

Please help! Thanks in advance.
VJ
April 29,
To overcome this problem I have implemented the following:

1. save the onControlTextChanged vcalue for all the controls you want to update
2. for all controls you want to change set onControlTextChanged to null
3. reset the onControlTextChanged to original value.

This will keep all the controls for making calls whne their value is changed.

(really short example):

_UI7_.onControlTextChanged = function(){
var oSaveTC = _UI8_.onControlTextChanged ;
_UI8_.onControlTextChanged = null;

_UI8_.setControlText('SELECT');

_UI8_.onControlTextChanged = oSaveTC;
}

Erik Dobrie
April 29,
Thanks a lot Eric, this idea works great!!
VJ
May 4,

This topic is archived.

See also:


Back to support forum