On 9 Dec 2005, at 03:50, Papadogiannakis Vagelis wrote:
mt1 wrote:
Hi
When i need two event, i always write it as following.
<some tag onclick="methodName()" onkeydown="methodName()">
<method name="methodName">
some code
</method>
</some tag>
Is there a better method ?
I'm not aware of one. I think it is unusual to have a single handler
for different events, so there is no shortcut.
i dont really know if it is better, but I am sure there is an
alternative, which is better in terms of code readabillity
<sometag>
<method event="onclick">
some code
</method>
<method event="onkeydown">
some other code
</method>
</sometag>
Note that there is an [enhancment proposal](http://
wiki.openlaszlo.org/Enhancement_Proposals) [EP 219](http://
wiki.openlaszlo.org/Event_and_handler_tags) to change the syntax of
events and handlers. Under that proposal, you would write:
<sometag>
<handler name="onclick">
some code
</handler>
<handler name="onkeydown">
some other code
</handler>
</sometag>
Comments on that proposal are welcome.
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user