ftroop
04-14-2005, 10:31 AM
Hi,
<b>I am using 3.0b2.</b>
Building on the following threads:
http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=2263&highlight=getSelectionPosition
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=665&highlight=getSelectionPosition
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=809&highlight=getSelectionPosition
I am simply trying to get the starting position and size of SELECTED text within a body of text entered
into an inputtext component. This is proving less straight-forward than I had hoped. My code is similar to the following:
<view name="my_view">
<inputtext name=itext" width="200" height="75">
<method event="onselected" args="k">
<![CDATA[
debug.write(this + ".onselected"+"-"+k);
Debug.write('onselected pos :'+ getSelectionPosition());
Debug.write('onselected size :'+ getSelectionSize());
]]>
</method>
</inputtext>
</view>
I want the Debug statements above to fire whenever a user enters some text and highlights, with the mouse, certain portions of that text. The code above never seems to get the onselected event and no debug statements are written.
In sum, I am wondering:
1.) Does the 'onselected' event work as I have used it, or am I using it incorrectly, in the wrong place, whatever?
2.) Do getSelectedPosition() and getSelectedSize() work in 3.0b2? If so, how are they to be correctly used?
3.) Should I be using a different event for this? I've tried several others to no avail. For example, ondblclick returns -1's for both getSelectedPos. and getSelectedSize.
Thanks in advance!
<b>I am using 3.0b2.</b>
Building on the following threads:
http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=2263&highlight=getSelectionPosition
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=665&highlight=getSelectionPosition
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=809&highlight=getSelectionPosition
I am simply trying to get the starting position and size of SELECTED text within a body of text entered
into an inputtext component. This is proving less straight-forward than I had hoped. My code is similar to the following:
<view name="my_view">
<inputtext name=itext" width="200" height="75">
<method event="onselected" args="k">
<![CDATA[
debug.write(this + ".onselected"+"-"+k);
Debug.write('onselected pos :'+ getSelectionPosition());
Debug.write('onselected size :'+ getSelectionSize());
]]>
</method>
</inputtext>
</view>
I want the Debug statements above to fire whenever a user enters some text and highlights, with the mouse, certain portions of that text. The code above never seems to get the onselected event and no debug statements are written.
In sum, I am wondering:
1.) Does the 'onselected' event work as I have used it, or am I using it incorrectly, in the wrong place, whatever?
2.) Do getSelectedPosition() and getSelectedSize() work in 3.0b2? If so, how are they to be correctly used?
3.) Should I be using a different event for this? I've tried several others to no avail. For example, ondblclick returns -1's for both getSelectedPos. and getSelectedSize.
Thanks in advance!