I should add that there is a certain magic translation of core class names <br>from LZX to Javascript that is happening, so <view> actually corresponds to<br>the real class named LzView, same for most of the core classes that are
<br>user visible. The magic happens via the static var declaration in a class called "tagname":<br><br>class LzView extends LzNode {<br>static var tagname = 'view';<br>..<br><br><br>As Tucker said, if you redefine a core class like that, you do so at your own risk,
<br>all sorts of things will probably break.<br><br><div><span class="gmail_quote">On 7/10/07, <b class="gmail_sendername">P T Withington</b> <<a href="mailto:ptw@openlaszlo.org">ptw@openlaszlo.org</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Welcome to dynamic languages. Yes, it is allowed. If you really<br>wanted to, you could replace the core classes too. And, yes, it will
<br>probably cause a problem if you do.<br><br>In general, Javascript emphasizes flexibility over safety. IMO, Java<br>leans the other way.<br><br>On 2007-07-10, at 13:29 EDT, Pierre Augier wrote:<br><br>> I all !!<br>
><br>> i 'am asking if it's possible to override core class by inclusion<br>><br>> i mean something like this :<br>> ----------------------------------------------------<br>><br>> #file /mypath/view.lzx
<br>><br>> <class name="view"><br>><br>> // my own view class<br>><br>> </class><br>><br>><br>> and later...<br>><br>> #file /myotherpath/myapp.lzx<br>><br>> <include href="/mypath/view.lzx"/>
<br>><br>> <canvas><br>><br>> <!-- use of the overrided class --><br>> <view name="lalala" /><br>><br>> </canvas><br>><br>> ----------------------------------------------------
<br>><br>> I've tried with "view" and "text" as class name ==> does<br>> not work (compilation error)<br>> then i've tried with "menu" or "button" ==> it
<br>> work althought i get a warning message in debug console<br>><br>> i guess it's because view and text are in the LFC, but menu and<br>> button are component ...<br>><br>> but my question is:<br>
><br>> except for LFC that sems impossible to override, for the other<br>> class, is this allowed ?? will cause problem ???<br>><br>><br>> thanks<br>><br>> Pierre<br>><br>><br><br></blockquote>
</div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>