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 &quot;layout&quot;, 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, &quot;node&quot;, 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>&lt;class name=&quot;myclass&quot;&gt;<br>&nbsp;&nbsp; &lt;attribute name=&quot;titleview&quot; type=&quot;node&quot;/&gt;<br><br>
&nbsp;&nbsp; &lt;handler name=&quot;oninit&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.titleview.setAttribute(&#39;bgcolor&#39;, 0xcccccc);<br>&nbsp;&nbsp; &lt;/handler&gt;<br>&lt;/class&gt;<br><font color="#888888"><br><font color="#000000">Then elsewhere you could say<br>
<br>&nbsp; &lt;myclass&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;view name=&quot;titleview&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ....<br>&nbsp;&nbsp;&nbsp; &lt;/myclass&gt;<br><br>And the compiler would not complain. <br></font><br><span style="color: rgb(0, 0, 0);">The existing compiler&nbsp; behavior would be changed so that for any attribute type<br>
except &quot;node&quot;,&nbsp; if you name a child node<br>with the same name as that&nbsp; 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>