Also:
lz.[tagname]
should be:
lz[tagname]
As in:
<class name="foo" ... />
the "tagname" is `foo`
so to make one you can say:
new lz.foo
or:
new lz['foo']
or also, if you want to instantiate a variable class, you might have:
var theclass = 'foo';
...
new lz[theclass];
will make a `foo` instance. This is pretty important to convey
somehow, as even sophisticated users miss this and try to use `eval`
(which won't work) instead. See: http://jira.openlaszlo.org/jira/browse/LPP-7303
On 2008-11-20, at 00:09EST, Henry Minsky wrote:
In
http://labs.openlaszlo.org/trunk-nightly/docs/developers/class-inheritance.html
in section 7, these paragraphs appear
7. Class Names and Tag Names
All classes are defined in the global namespace. If you wanted to
instantiate a class dynamically, you can write new
global[classString](...).
Using the previous example, mybox can be instantiated like new
global['mybox'](canvas.redbox, { bgcolor: 0x00ffff }).
7.1. Mapping Class and Tag Names
Be aware that names for tag classes are not the same as their
JavaScript
counterpart; rather, the JavaScript name is lz.[tagname]. For
example, to
access a <view> in script, you would use lz.view. Thus, to
instantiate a
view through script, you would write new lz.view(...) (not new
view(...)).
Note
In earlier versions of OpenLaszlo, there was an idiosyncratic mapping
between class names and tag names, and classes in the LFC were
handled
differently than user defined classes. For example, the tagname
<view>
mapped to JavaScript class lz.view. With OpenLaszlo 4.0, the lz.
[tagname]
mapping is universal, and the old mappings are deprecated.
I think the first paragraph can just be deleted.
The last paragraph note about earlier versions looks like it got
substituted
by accident in a search and replace, and ought to read "For
example, the
tagname <view> mapped to JavaScript class LzView"
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]