Hmm.... to get me an overview:

The createLink("someurl") method of the RichTextArea in GWT 1.5
Release Candidate 2

Safari 3.1.2 (5525.20.1) on OS X 1.5.4
No selection: inserts the link <a href='someurl'>someurl</a> at the
current cursor position.
Selection "sometext": replaces the selection "sometext" with <a
href="someurl">sometext></a>

Firefox 3.0.1 on OS X 1.5.4
No selection: nothing happens.
Selection "sometext": replaces the selection "sometext" with <a
href="someurl">sometext></a>

Mozilla on Windows:
No selection: nothing happens.
Selection "sometext": replaces the selection "sometext" with <a
href="someurl">sometext></a>

IE on Windows:
No selection: nothing happens.
Selection "sometext": replaces the selection "sometext" with <a
href="someurl">sometext></a>


It appears to me that this is the normal behaviour - when no text is
selected, it is not allowed to create a link, thus the command is
called createLink and not insertlink.
While searching for some reasons, and looking at other rich text
implementations in other frameworks, i've seen that some of them are
using the inserthtml which is only supported by firefox (see
http://www.quirksmode.org/dom/execCommand.html for a comparism, a
sample application is here: http://www.quirksmode.org/dom/execCommand/
a quick test with inserthtml in safari seemed to work, but might not
in older versions)
The command insertHtml would allow to insert something like <a
href='someurl'>sometext</a> directly.
The only way I know where i could simulate something similar in IE is
to insert a "fake" image, get the whole html from the richtext widget,
parse and replace the "fake" image in the original html with <a
href='someurl'>someurl</a> and use setHtml() on the widget. This
should work but I think the current cursor position would then be
lost.

Any other ideas?

thanks
phil.

On Aug 22, 7:41 pm, Sridhar Cheguri <[EMAIL PROTECTED]>
wrote:
> Hi,
>
>  Even I'm experiencing the same issue with the IE and Mozilla on my
> windows, when i select the createLink or insertImage both are not
> working has expected.
>
> Thanks,
> Sridhar
>
> Phil wrote:
> > Hi Sumit
>
> > Thanks for your reply.
> > You were right, i was talking about the createLink() method. I've
> > found out that in Firefox 3 on Mac with GWT 1.5RC2 I can only insert a
> > link (richtextArea.createLink("someurl")) when I have selected some
> > text in the richtextarea. if i have no selection, nothing appears in
> > the RichTextArea.
> > I do not know if this is the expected behaviour. I guess so, as the
> > createLink() method takes only one parameter (So there is no way you
> > can set a title and an url for the resulting link).
>
> > What confused me is that in Safari (3.1) / Hosted Mode, i can insert /
> > create a link without having a selection. The link gets inserted at
> > the correct cursor position and with the url as name.
> > For example:
>
> > .createLink("someurl")
> > generates a:
>
> > <a href='someurl'>someurl</a>.
>
> > in the html of my RichTextArea.
>
> > kind regards
> > Phil
>
> > On Aug 19, 11:48 pm, "Sumit Chandel" <[EMAIL PROTECTED]> wrote:
> > > Hi Phil,
>
> > > Which version of GWT are you using? There doesn't seem to be an 
> > > insertLink()
> > > method exposed on RichTextArea in GWT 1.5 RC2. I think this has been
> > > subsumed by the createLink() method available on the ExtendedFormatter. 
> > > Can
> > > you try using the createLink() for your use case instead and see if that
> > > works?
>
> > > If not, the issue might be related to Issue #924. The issue describes that
> > > setText() and setHTML aren't working properly for some developers in 
> > > Firefox
> > > 2 due to what seems to be a timing issue between when the underlying 
> > > iframe
> > > of the RichTextArea is initialized and the setText()/setHTML() methods are
> > > invoked. In this case, it could be that the createLink() method would fail
> > > for the same reasons.
>
> > > Issue 
> > > #924:http://code.google.com/p/google-web-toolkit/issues/detail?id=924
>
> > > Hope that helps,
> > > -Sumit Chandel
>
> > > On Fri, Aug 15, 2008 at 2:43 AM, Phil <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Everybody
>
> > > > First of all: Thanks to everbody out there who helps improving and
> > > > creating this genious framework. Without this effort, my work would be
> > > > only half as fun as it is.
>
> > > > I am working with the latest 1.5 Release Candidate and I am
> > > > experiencing some problems with the RichTextArea Widget and Firefox.
> > > > When I try to insert a link (RichTextArea.insertLink(String ...)),
> > > > nothing happens in Firefox 3. This works without any problem in Safari
> > > > 3.
> > > > The problem occurs both in my own code and with the Showcase example.
> > > > I work on the latest Mac OSX, Leopard.
> > > > Is this a known issue? Does anyone have similar problems on the same
> > > > or on different platforms?
> > > > Does the RichTextArea work fine on Windows with Firefox 3?
>
> > > > Thanks for helping out, i will post updates and patches if i've found
> > > > something.
>
> > > > Kind regards
> > > > phil
--~--~---------~--~----~------------~-------~--~----~
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