I've also been trying to work with selections in GWT and found this
GWT extension:
http://code.google.com/p/rocket-gwt/wiki/Selections
It works with GWT 1.5, I don't know if it has been tested with GWT
1.6. I haven't used it myself
Text selections seems like a fairly important thing, does
found the answer.
FF uses $wnd.getSelection().getRangeAt(0)
thanks for all the help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Google Web Toolkit group.
To post to this group, send email to
Thanks for the clarification. I am sure I am close now. but still get
an error. my code is
private native Element getSelectedTextParent() /*-{
var range = null;
if($wnd.document.selection){
range =
On Jun 5, 11:14 pm, bhomass bhom...@gmail.com wrote:
I looked up some cross browser code. but I am getting different
results
if (document.getSelection) {
var range = document.getSelection().createRange();;
} else if (document.selection document.selection.createRange) {
var
I looked up some cross browser code. but I am getting different
results
if (document.getSelection) {
var range = document.getSelection().createRange();;
} else if (document.selection document.selection.createRange) {
var range = document.selection.createRange();
} else {
var
On 5 juin, 22:14, bhomass bhom...@gmail.com wrote:
I looked up some cross browser code. but I am getting different
results
if (document.getSelection) {
var range = document.getSelection().createRange();;
} else if (document.selection document.selection.createRange) {
var
Hi,
Seems there is something strange going on with search - I answered
your question and can't see the reply either!
The $ before doc is due to GWT loading into an IFrame - GWT ensures
that $doc points to the window's document object (you can read more on
that in the JSNI documentation from GWT
I have a native method which uses
$doc.selection.createRange()
I am not sure why the $ before doc. I simply copied it from some
sample code. this method works find when in hosted mode. but after
compile and called directly from a browser I get the $doc.selection is
undefined error.
any one