PDA

View Full Version : text or view not recognizing events - onclick, onmouseover


ch_bowen
09-11-2003, 07:32 AM
I am having problems with my view recognizing events such as 'onclick', 'onmouseover'. Here is a code snippet of what I am trying to do. Your help is appreciated:

<view x="300" height="40" width="600" visible="true" name="buttonsBar">
<view name="buttons">
<view name="producers">
<method event="onclick">
debug.write("clicked");
</method>
<method event="onmouseover">
debug.write("moused over");
</method>
<text name="txtProducers" height="16" fontstyle="bold" fgcolor="blue">
<method event="onclick">
debug.write("clicked");
</method>
<method event="onmouseover">
debug.write("moused over");
</method>
<font size="14">
Producers
</font>
</text>
<view name="underline" x="1" y="17" height="2" width="71" bgcolor="red"/>
</view>
<simplelayout axis="x"/>
</view>

ch_bowen
09-11-2003, 07:38 AM
forgot to set attribute 'clickable=true' on the text tag.

antun
09-11-2003, 08:17 AM
FYI you don't need to set clickable="true" if you use the onclick event handler in the tag, for example: <view onclick="true" />. However if you nest a method that's tied to the onclick event inside of that view, then you do have to explicitly set that view's clickability.

-Antun