Sorry my message got cut off before I could finish it:<br><br>This is a proposal in response to this bug, which came up when someone named a child view "layout", and got<br>unexpected results in a view.<br clear="all">
<br><a href="http://jira.openlaszlo.org/jira/browse/LPP-5799" target="_blank">http://jira.openlaszlo.org/jira/browse/LPP-5799</a><br>
<br>The current compiler behavior is that it will allow you to declare a child with the same name as an attribute,<br>as long as the attribute has a null default value. This unfortunately applies to virtually every attribute<br>
declared in the schema, so in practice you can easily shadow all sorts of important properties in<br>a view or node, by naming a child view with the same name as a class attribute, with no warning from the compiler.<br><br>
This proposal is that we add a new LZX attribute type, "node", which you can use to declare that<br>
an attribute name can have the same name as child node.<br><br>So for example you could have<br><br><class name="myclass"><br> <attribute name="titleview" type="node"/><br><br>
<handler name="oninit"><br> this.titleview.setAttribute('bgcolor', 0xcccccc);<br> </handler><br></class><br><font color="#888888"><br><font color="#000000">Then elsewhere you could say<br>
<br> <myclass><br> <view name="titleview"><br> ....<br> </myclass><br><br>And the compiler would not complain. <br></font><br><span style="color: rgb(0, 0, 0);">The existing compiler behavior would be changed so that for any attribute type<br>
except "node", if you name a child node<br>with the same name as that attribute, you get a compiler warning, regardless of<br>whether the attribute was declared with a default value.<br style="color: rgb(0, 0, 0);">
</span><br><br><br></font>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>