Re: $doc.selection is undefined in GWT

2009-06-22 Thread chardina...@boyd.org.nz
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

Re: $doc.selection is undefined in GWT

2009-06-10 Thread bhomass
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

Re: $doc.selection is undefined in GWT

2009-06-07 Thread bhomass
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 =

Re: $doc.selection is undefined in GWT

2009-06-06 Thread alexey.dashkev...@gmail.com
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

Re: $doc.selection is undefined in GWT

2009-06-05 Thread bhomass
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

Re: $doc.selection is undefined in GWT

2009-06-05 Thread Thomas Broyer
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

Re: $doc.selection is undefined in GWT

2009-06-04 Thread Adam T
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

$doc.selection is undefined in GWT

2009-06-03 Thread bhomass
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