I tried to include the getCursorPos() of TextArea in RichTextArea

private static RichTextAreaImpl impl = GWT.create(RichTextAreaImpl.class);

public int getTextAreaCursorPos(Element elem) 
{
    return getCursorPos(elem);
}
public int  getCursorPos() 
{
    return getTextAreaCursorPos(getElement());
}

protected RichTextAreaImpl getImpl() 
{
    return impl;
}

public native int getCursorPos(Element elem) 
/*-{
    // Guard needed for FireFox.
     try{
       return elem.selectionStart;
     } catch (e) {
       return 0;
     }
 }-*/;


but due to JSNI I can't figure out what's going on with selectionStart.

elem.selectionStart returns always 0

Please any idea? Thank you!!!


On Tuesday, October 9, 2012 2:18:57 PM UTC+1, jimakos17 wrote:
>
> I am trying to create an area and initially I used the RichTextArea in 
> order to use functions like toggleBold, toggleItalic and toggleUnderline.
> After a few days I noticed that in comparison with the TextArea, there are 
> no getCursorPos and getSelectedText methods which are very essential 
> in order to handle my editor.
> Do you know if there is any way to combine these functionalities or how 
> can I use getCursorPos and getSelectedTextin in RichTextArea?
> Thank you very much.*
> * 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/jagBK-SLbDcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to