Not sure what exactly you've already tried, but have you looked at
NativePreviewHandler?  Something like:

Event.addNativePreviewHandler(new NativePreviewHandler() {
  public void onPreviewNativeEvent(NativePreviewEvent myEvent) {
  ...
 }
}

kathrin

On Thu, Apr 8, 2010 at 3:43 PM, kozura <[email protected]> wrote:

> So working on a cross-browser range object so I can properly handle
> links in my RichTextArea.  Finally worked out how to divine the
> selection using IE's blasted API, but it wasn't working to retrieve
> the cursor position when no selection (end point == start point).  And
> finally realized the problem is when I click on my button to create a
> link, the cursor selection becomes invalid before my callback that
> fetches it, and the cursor is placed in the button.  In FF/Safari I'm
> able to retrieve this properly, even though the cursor also is placed
> in the button after my call.
>
> Something does seem to handle this right for the commands like indent
> - if I click on a piece of text and then click the indent button, it
> properly indents the correct text and leaves the cursor in at the same
> location in the text, not in the indent button.  But only short term -
> if I put the cursor in some unrelated place outside of the RTA, then
> click indent, it puts the cursor at the beginning of the text in the
> RTE and indents from there.  In FF doing this remembers the last
> cursor position and indents the correct text.
>
> I tried an onBlur handler, but it seems the selection is lost before
> that.  The only thing I've gotten to work is an onMouseOut, which
> unfortunately gets called when the mouse leaves any of the sub-
> elements of the RTA iframe, but I can check the coordinates and only
> grab the selection when they're outside of the iframe.  But this seems
> pretty inelegant, anyone have any better ideas on how I could grab the
> selection before IE whisks it away?
>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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.

Reply via email to