This line in collectNamedChildren looks superfluous:
+ String childEltName = child.element.getName();
Approved if you file the bug you mention below.
On 2008-08-13, at 15:39EDT, Henry Minsky wrote:
Change 20080813-hqm-V by [EMAIL PROTECTED] on 2008-08-13
13:36:46 EDT
in /Users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: make tag compiler hoist named children from states to
parent as swf9 declarations
New Features:
Bugs Fixed: LPP-6741
Technical Reviewer: ptw
QA Reviewer: pbr
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
When building the NodeModel, if any children of a node are <state>
or subclass of <state>,
recursively find any named nodes in them, and declare those as
attributes of the NodeModel,
so that they get declared as instance vars in swf9. Note that this
applies to nested
states, e.g. 'foobar' below will be declared as an attribute in the
parent view,
<view name="parent">
<state>
<state>
<state>
<view name="foobar"/>
..
This allows them to be referenced without prefixing them with
"this.xxx", which is what
code in grid component expects, an probably in other people's code
as well.
The name attributes are only declared if there is no pre-existing
declaration for that name. Pre-existing
attribtues would be ones which were explicitly declared by the user
(e.g., <attribute name="foo"...>)
or else normal named children.
Note that if there is a state which declares a child named "foo" and
there is already a child named foo,
the compiler will not warn about that. Maybe we should file a bug
for that case.
Tests:
examples/components/grid_example swf9
examples/components/components_example swf9
smokecheck swf8,dhtml
Files:
M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
M lps/components/lz/gridcolumn.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080813-hqm-V.tar