Currently, canvas only supports onmouseup/down/move - and they are global events sent from lz.GlobalMouse. As a workaround, you could try:

<canvas>
 <view bgcolor="#FF0000" height="100" width="100" name="myview">
<handler name="onclick" reference="lz.GlobalMouse">Debug.write('hello!');</handler>
 </view>
</canvas>

I agree this is somewhat confusing, especially since the documentation lists onclick as being inherited from view. Can you file a bug at http://jira.openlaszlo.org/?

Regards,
Max Carlson
OpenLaszlo.org

On 4/15/10 9:16 AM, Quirino Zagarese wrote:
Hi there,
I found out that onclick handlers referencing other objects than "this"
are not working.
Here is an example.

<canvas>
<view bgcolor="#FF0000" height="100" width="100" name="myview">
<handler name="onclick" reference="canvas">Debug.write('hello!');</handler>
</view>
</canvas>

If you switch to "onmousedown", everything works.
Regards,

Quirino

--
Quirino Zagarese

Italian OpenLaszlo Community  - www.laszloitalia.org
<http://www.laszloitalia.org>

EU4RIA: Laszlo+Java, easily - eu4ria.googlecode.com
<http://eu4ria.googlecode.com>

Reply via email to