View Full Version : id attribute
fighne
11-28-2008, 02:16 AM
Ok after a long hiatus I'm back to Laszlo now OpenLaszlo.
Have just read Autun's Blog about the id attribute and wondered what is the approach to defining an attribute in an object?:confused:
rcyeager
12-03-2008, 07:31 AM
Your question doesn't make any sense to me. His blog article shows how to specify attributes when instantiating an object from script. Are you asking how to do so declaratively?
Robert Yeager
http://www.qrowd.com
http://www.cooqy.com
fighne
12-04-2008, 12:55 PM
yes
what I would like to do is create a class of button, read an xml file in and dependent upon how many nodes there is create the same amount of buttons.
each having a different id.
Does that make sense?
rcyeager
12-04-2008, 01:18 PM
Sounds like in LPS 4.2.x that won't be possible as Antun's blog documents.
IMO using id's is bad programming form anyways. They are global and can collide, let alone that they don't give a clue as to where they are defined. I only use them as a crutch of last resort when it makes a particular section code easier to manage, similar to how "goto" statements were treated long ago. Note that the LPS component library doesn't use id's...as it shouldn't, for id's don't lead to modular code re-use.
Using the "name" attribute is better form IMO. You can set the name attribute on dynamically instantiated objects.
Robert Yeager
http://www.qrowd.com
http://www.cooqy.com
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.