[Laszlo-dev] still confused about referencing node id's from methods
P T Withington
ptw at openlaszlo.org
Tue Apr 1 10:03:49 PDT 2008
I don't understand. Isn't global supposed to be the outermost scope
and where free refs will be looked up?
On 2008-04-01, at 11:25 EDT, Henry Minsky wrote:
> This code
> <view id="v1" width="100" height="20" bgcolor="red"/>
> <view id="v2" width="100" height="20" y="100" x="${v1.x + v1.width
> + 20}"
> bgcolor="blue"/>
>
> compiles to a constraint method:
> $lzc$bind_x$v2_$m10:
> function ($lzc$ignore = null) {
> this.setAttribute("x", v1.x + v1.width + 20);
> }
>
>
> $lzc$dependencies_x$v2_$m10:
> function () {
> return [v1, "x", v1, "width"]
> }
>
>
> But nodes which have id's set them on the "global" object. So how
> can we
> expect these references to work? Did we decide we need
> to put with (global) {...} around all method bodies? Or have the
> compiler
> find all id's at compile timeand make real top level vars for them?
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list