[Laszlo-user] suggested way to check for class type in Wafflecone?

Elliot Winard enw at laszlosystems.com
Thu Aug 30 07:01:19 PDT 2007


I have some window management code that iterates through an array of 
different windows & switches on the exact window type.

It used to work with code like this -
           var w=getNextWindow();

            // classname can be composewindow, mailwindow, contactswindow
            if(w.classname == "composewindow") {               
                return w;
            }

This stopped working because w.classname is now Object. 
w.constructor.classname is, however, 'composewindow'

What's the right way to do this?  Should obj.classname be the same as 
obj.constructor.classname?
I want to make sure this works when & if OpenLaszlo is updated.
Thx,
-e




More information about the Laszlo-user mailing list