Paste text at current cursor position WebTextArea

I’m looking for a way to paste a text string into a WebTextArea at the current cursor position. However it is not even (natively) possible to determine the current cursor position. Does anyone know a (java) trick to paste at current pos?

For javascript, here’s an example of a way to get the selection points of a textbox:

function textbox() { var ctl = document.getElementById('Javascript_example'); var startPos = ctl.selectionStart; var endPos = ctl.selectionEnd; alert(startPos + ", " + endPos); }

You can call executeJavaScript on the page or control or whatever really and then use a helper version of the webControlWrapper to send any “custom events” you want back to the server.