Check out lps/components/incubator/newcombobox

This is much more efficient for the kind of situation you describe. It's a 
data-backed combobox.

A

On Nov 22, William Krick wrote:

> In our app, we have to be able to replace the list of items in various
> comboboxes often.  So we extended combobox and added a setItems() method.
> However, the part that removes the old
> items is brutally slow.  In fact, it seems to be faster for us to destroy
> the combobox and create a new one than it is to remove the items.  However
> destroying comboboxes at runtime just feels wrong and I'm sure will lead to
> memory leaks and other problems.  Below is our code.  Any thoughts would be
> appreciated...
> 
> <class name="comboboxex" extends="combobox">
>   <method name="setItems" args="list">
>     <![CDATA[
>       //First, remove items...
>       while(this.getItemAt(0) != null) {
>         this.removeItemAt(0);
>       }
>       //Then, add items passed in
>       for (var i=0; i<list.length; i++) {
>         this.addItem(list[i], i);
>       }
>     ]]>
>   </method>
> </class>
> 
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> 
> 
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to