[Laszlo-dev] This code gets an error in legals, but not in trunk, something with binding of node names?

Henry Minsky henry.minsky at gmail.com
Wed Jan 10 10:04:08 PST 2007


On 1/10/07, P T Withington <ptw at openlaszlo.org> wrote:
>
> When I run your example through lzc, I don't see any code emitted for
> the dataset tag in trunk.  (Huh?)  But in legal's, I see:



Hmm, I remember seeing a bug saying something like that, that  top level
datasets were disappearing silently in trunk, I wonder why there was no
error reported when the 'remotecall' dataobject attribute tried to reference
it as an initial value, I better look at the compiled code more carefully
for what the setter thinks it is doing, and when.

LzInstantiateView({attrs: {initialdata: "<datacontent />", name:
> "mydata"}, name: "dataset"}, 1);
>
> Which seems to be the opposite of what you are seeing.  But, maybe
> the clue lies in what the tag compiler is generating (or not).
>
> On 2007-01-10, at 05:18 PST, Henry Minsky wrote:
>
> > it is bound globally when I evauate 'mydata' in the debugger after
> > the app has initialized. Something is preventing it from showing up
> > when the 'remotecall' instance is initializing it's attributes. I'm
> > trying to figure out if this is because the
> > name is not getting bound that early, or because the context in
> > which globals are evaluated is wrong for initializing attributes.
> > If the latter were the case I'd expect a lot more things to be
> > broken though.
> >
> > On 1/10/07, Max Carlson <max at openlaszlo.org> wrote: Perhaps mydata
> > has an id but not a name in the canvas?
> >
> > -Max
> >
> > Henry Minsky wrote:
> > > The code below is a trimmed down testcase from the rpc library.
> > It gets
> > > this
> > > error in legals but not in trunk:
> > >
> > > ERROR: foo.lzx:12: reference to undefined variable 'mydata'
> > >
> > > The line 12 is trying to evaluate the variable "mydata", which
> > should be
> > > bound to the <dataset> that
> > > is declared before it.  It is in trunk, but in legals the value
> > isn't bound
> > > yet when the "remotecall" instance is being created.
> > >
> > > If  I print it's value from the debugger, after things have inited,
> > > mydata is
> > > properly bound to a dataset.
> > > So something is weird with either the context in which the name
> > 'mydata' is
> > > evaluated, or the order in which the name gets set on
> > > a node.
> > >
> > >
> > > <canvas width="800" height="800" debug="true">
> > >
> > >    <debug x="300" y="20" width="500" height="400" />
> > >
> > >    <class name="remotecall" extends="node">
> > >        <attribute name="dataobject" value="null"
> > type="expression" />
> > >    </class>
> > >
> > >    <dataset name="mydata" />
> > >
> > >    <view id="foo">
> > >        <remotecall dataobject="mydata" />
> > >    </view>
> > > </canvas>
> > >
> > >
> > >
> >
> >
> > --
> > Regards,
> > Max Carlson
> > OpenLaszlo.org
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
> >
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20070110/1e5832fd/attachment-0001.html


More information about the Laszlo-dev mailing list