How to get cursor position from multiline RichTextArea in GWT?

I've already read the former article "How to get cursor position or location from RichTextArea in GWT". And the solution work so far. After my implementation I was able to track the cursorposition as long as I wrote a single line.

I have no clue how to alter the solution to track the cursor position over more than one line.

Error-example:

"My name is Tharmar.|"   Position = 19(19) => correct
"My name is Tharmar.
 and I hope someone can help me|" Position = 30(49) => incorrect 

(int) = correct position
|=cursor

I would like to alter the solution to get the "absolute" position of the curser within the RichTextArea. Is there a possibility to aggregate the positions (19+30)?

Can someone help me or point me in the right direction?

FYI: I have no experience with JavaScript!

链接地址: http://www.djcxy.com/p/65472.html

上一篇: GWT RichTextArea不捕获onBrowserEvent(Event.ONPASTE)

下一篇: 如何从GWT中的多行RichTextArea获取光标位置?