BINGO!

Now you see what I'm facing.  If there's not some way to speed up this code,
I'm not sure that many people are going to be able to use laszlo for "real"
applications.  Laszlo will be relegated to being a fancy replacement for
HTML forms.



-----Original Message-----
From: Mike Sugarbaker [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 23, 2005 5:38 AM
To: William Krick
Subject: Re: [Laszlo-user] is there any way to make this code faster?


Wow.. I was all set to tell you to use something like for (var x =
this.items.length - 1; x >= 0; x--) instead of a while statement...
but it looks like not only is there no way to get the number of items
in a combobox, but there's no way to get the number of children of any
LzNode without iterating through them.

Am I wrong? This could be a huge performance hit for many things if I'm
right...

On 11/22/05, William Krick <[EMAIL PROTECTED]> 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
>


--
______________
Mike Sugarbaker
Super Geiniuis


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to