[Laszlo-user] 'Templating' classes

Robin robin at kallisti.net.nz
Mon Apr 3 04:54:41 EDT 2006

Hi, more questions :)

I'd like to be able to instantiate a class, such as like this:
<dataview id="dataarea" datapath="data:/data" >
	<text resize="true" align="center" valign="middle"/>

Where the <text> element in the middle isn't a text object, but something that
dataview can use to display its data, i.e. it may not be <text> but may be
<myfancydatadisplay>, and whatever it is gets instantiated (maybe multiple
times) later, and given the data that its supposed to show. I'll have them
share a common interface, so they can all be set in the same way. Note that is
different to the list class, in that with list you create the instances of the
entries immediately (typically).

It would be even better if it was possible to dynamically change this, by
somehow setting the class for dataview to instantiate to something else.

Hmm. I guess that I'm looking for something like the Java factory pattern.

Can anyone point me in the right direction?

Cheers, Robin.

More information about the Laszlo-user mailing list