[Laszlo-user] Views as attribute object of a class
P T Withington
ptw at openlaszlo.org
Fri Jun 2 08:47:08 EDT 2006
On 2006-06-01, at 19:08 EDT, Adam Wolff wrote:
> Actually, I think this may be part of your problem
>> <method name="init" event="oninit">
>
> This will get called twice -- once because it's an override of the
> view's
> init method, and once because it responds to the view's oninit event.
Luckily, in the new event/handler syntax, it will be somewhat harder
to make this mistake. You will have to write:
<method name="init"> ... </method>
<handler name="oninit" method="init" />
BTW, this is the second time I have seen someone make this mistake in
a week. The other pattern was:
<view oninit="init">
<method name="init"> ... </method>
</view>
Which will still be very easy to write.
Perhaps there needs to be a more prominent documentation of which
methods also have events associated with them? I wonder if the tag
compiler could detect and warn for the case where an event handler is
wired to the method that sends the event?
[If our event system propagated events that trigger events, these
patterns would have had more obvious failure modes.]
More information about the Laszlo-user
mailing list