Hello I was looking for something similar: Getting the current position of cursor in RichTextArea. May be you could help me in this case... I tried to search everywhere. An old post here demonstrates a javascript snippet doing this but I could not get it working.
Thanks e.v.e wrote: > Hi, > > I am trying to create an inplace editor on top of RichTextArea. It was > easy to implement a basic functionality: I have a DeckPanel, which > contains FocusPanel (which in turn contains HTML widget) and > RichTextArea, when user clicks on FocusPanel RichTextArea is shown and > focused. But here the problem arises: RichTextArea's caret appears at > the beginning of the text, while I want it to appear where user > clicked. > > At first I thought that RichTextArea is implemented entirely in JS, so > I can easily find a way to move caret. But I browsed GWT sources and > then spent some time googling and it now appears to me that > RichTextArea is implemented in a very tricky way, so it lacks API for > caret control (everything is controlled entirely by browser). Then I > thought that I can just fire a mouse click event or some how redirect > mouse click from FocusPanel to RichTextArea, but unfortunately I could > not find a way. In fact I found info about JS functions called > dispatchEvent (fireEvent in IE); but I am not sure how to call them > correctly from GWT. > > Any ideas? The problem seems solvable, because I saw that inplace > editor in Google Notebook behaves correctly (caret is placed where > user clicked). > > I am totally new to GWT and JS, so there is a possibility that I am > missing something simple. > > Thanks, > Vyacheslav Egorov. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
