@Milan I tried your code and added the additional default case and the
check for ol or ul but somehow it does not work
Here my implementation:
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONKEYPRESS:
if (getUserAgent().toLowerCase().contains("msie")) {
//check for IE
if (event.getKeyCode() == KeyCodes.KEY_ENTER) {
if (!toolbar.LIST_FLAG) { //if I'm not in list
mode
this.getFormatter().insertHTML("<br>");
} else { //if I am in list mode
super.onBrowserEvent(event);
}
} else
super.onBrowserEvent(event);
event.preventDefault();
}
break;
case Event.ONFOCUS:
if (getHTML() == null || getHTML().isEmpty()) {
this.getFormatter().insertHTML("<p><br></p>");
}
break;
default:
super.onBrowserEvent(event);
}
}
On Thursday, February 14, 2013 11:37:09 PM UTC+1, Milan Cvejic wrote:
>
> Here you can find my solution to this:
> https://groups.google.com/d/topic/google-web-toolkit/t5OBuflQCzY/discussion
>
> There is one thing that you need to implement also, and that is to detect
> weather cursor is currently in ol or ul tags, and if so just call
> super.onBrowserEvent method and add default case where you will call same
> method.
>
> Milan
>
> On Thursday, February 14, 2013 12:15:08 PM UTC+1, Daniel Girtler wrote:
>>
>> I have the same problem in IE8 and IE9 is there a solution to this
>> problem?
>>
>> On Friday, April 24, 2009 12:10:34 AM UTC+2, [email protected] wrote:
>>>
>>> Hello everybody,
>>>
>>> Java: 6
>>> GWT: 1.6.4
>>> GXT: 2.0-m1
>>>
>>> IE : 7
>>> Firefox: 3.0.8
>>>
>>> The HtmlEditor behaves differently in Internet Explorer and Firefox by
>>> "new line"/"line break" (Enter).
>>> The HtmlEditor used internally the RichTextArea.
>>>
>>> IE converted the HtmlEditor "new lines" to HTMLTag - P:
>>> <P>dummy test</P>
>>> <P>dummy test</P>
>>> <P>dummy test</P>
>>>
>>> Firefox converted the HtmlEditor "new lines" to HTMLTag - BR:
>>> dummy test<br>dummy test<br>dummy test<br>dummy test<br>
>>>
>>>
>>> This behavior is also here (http://gwt.google.com/samples/Showcase/
>>>
>>> Showcase.html#CwRichText<http://gwt.google.com/samples/Showcase/Showcase.html#CwRichText>)
>>>
>>> understandable. Write more than one line in
>>> IE (Enter == P) and and then in Firefox (Enter == BR).
>>>
>>>
>>> What should I do, so he Internet Explorer (IE) shows/convert no
>>> longer "line break" to HTML-Tag P but to BR?
>>>
>>> Thanks
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.