[Laszlo-dev] event handler attributes

Henry Minsky henry.minsky at gmail.com
Mon Oct 29 16:18:34 PDT 2007


The way it currently works is that things declared with <event> can be given
script to run in the attribute, without a compiler warning. So if you have

  <class name="foo">
    <event name="onbar"/>
    <attribute name="xbar"/>
  </class>

  <foo id="baz" onbar="Debug.write('this is ok!')"
                       onxbar="Debug.write('this gives you a warning')"/>

You will get a warning for the  attribute assignment to "onxbar", but you
won't get one for the "onbar"






On 10/29/07, P T Withington <ptw at pobox.com> wrote:
>
> He is asking if with your new validator, users can finally create
> events that can be named in the open tag (the way only 'system' events
> could in the past, because they had to be declared in the schema).
>
> I think the right answer is that any event that is declared, e.g.:
>
> <event name="onripeness" />
>
> should be permitted in the open tag.  But implicit events should not.
> Below, in Ben's example, 'onripeness' is implicit.
>
> Along the same lines, in Ben's example, can I say:
>
> <fruit ripeness="..." />
>
> I.e., can I name _any_ attribute in the open tag now?
>
> On 2007-10-29, at 18:49 EDT, Henry Minsky wrote:
>
> > You mean if the user doesn't explicitly declare the event?
> >
> > On 10/29/07, Benjamin Shine <ben at laszlosystems.com> wrote:
> >>
> >>
> >> Henry, with the new validator, do we (want to) allow this scenario?
> >>
> >> <class name="fruit">
> >>  <attribute name="ripeness" ... />
> >> </class>
> >>
> >> <fruit name="avocado" onripeness="Debug.write('mmm ripe avocado')" />
> >>
> >>
> >>
> >
> >
> > --
> > 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/20071029/fe351e48/attachment.html


More information about the Laszlo-dev mailing list