I've seen many examples where JSNI is used, like the following:

private native void myJsniMethod(Element oElement)/*-{
  var oDoc = oElement.contentWindow;
  // var oDoc = oElement.contentWindow || oElement.contentDocument;
  if (oDoc.document != null) {
    oDoc = oDoc.document;
    // more actions here...
  }
}-*/;

I tried to use JSNI method too. But an error occurs when trying to call *
oElement.contentWindow* because its value is *null* (I've seen in Firefox,
In IE you cant see the reason for throwing the error). Why does it should
work in many examples you can find in the web? Is there anything special to
watch?

-Danny


2009/2/24 Danny Schimke <schimk...@googlemail.com>

> Hi Omer!
>
> 1. Yes I am using Windows and yes: Hosted Mode uses the installed IE.
> 2. The error occurs in compiled mode (Firefox, IE) too.
>
> I show a preview for multilingual text (english, german, french, etc.).
> It's font-family is shown in "Arial,Helvetica", but the RichTextArea is
> using the browsers font (If I am not mistaken!?). It does not look nice,
> when the editors text has a different font, than its preview...
>
> I hope I'll crack this in future ;)
>
> Thank you Omer!!!
> -Danny
>
> 2009/2/24 A Friend Of Yours <omer.akh...@gmail.com>
>
>
>> > Any Idea, why the error occurs?
>>
>> No; not really!
>>
>> If you could provide more details:
>> 1. Are you having this error in Hosted Mode or Web Mode?
>> Because some javascript trick don't work in Hosted Mode so things like
>> this happen.
>
>
>>
>> 2. Hosted Mode: Are you using Windows?
>> Hosted Mode browser in windows uses Internet Explorer components to
>> render its view (not sure if it is true though). While I used this in
>> linux where Hosted Mode uses mozilla components.
>>
>> 3. Web Mode: Goes without saying; are you using Internet Explorer for
>> Web Mode?
>> As I had mentioned, I have only tested this solution on Firefox in
>> Linux.
>>
>> Hope this helps
>>
>> Omer Akhter
>>
>> Danny Schimke wrote:
>> > I need to set the CSS for RichTextArea too and tried out your idea. I've
>> got
>> > the following Error in the first line where I create the Document object
>> > using my RichTextArea:
>> >
>> > com.google.gwt.core.client.JavaScriptException: (Error): Unknown Error.
>> >  number: -2147467259
>> >  description: Unknown Error.
>> >
>> > Any Idea, why the error occurs?
>> >
>> > Thanks!
>> > -Danny
>> >
>> > 2009/2/17 A Friend Of Yours <omer.akh...@gmail.com>
>> >
>> > >
>> > > Please try to maintain a single thread:
>> > >
>> > >
>> http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/4e1d0c2a8ba725ef
>> > >
>> > > On Feb 17, 8:10 pm, "Manish Kumar" <man...@oakdeneindia.com> wrote:
>> > > > Hi All,
>> > > >
>> > > > Could I please have any idea on this( in mail below ).
>> > > >
>> > > > Regards
>> > > > Manish
>> > > >
>> > > >   ----- Original Message -----
>> > > >   From: Manish Kumar
>> > > >   To: Google-Web-Toolkit@googlegroups.com
>> > > >   Sent: Tuesday, February 17, 2009 10:46 AM
>> > > >   Subject: Apply CSS in editor area of RichTextArea
>> > > >
>> > > >   Hi Everybody,
>> > > >
>> > > >   While working on adding RichTextArea with my project.I would like
>> to
>> > > apply css on editor area of Rich Text Area control so that I can set
>> font
>> > > behaviours ( font-family, font-weight,font-size etc ) being displayed
>> in the
>> > > rich text area editing area a bit changeable.
>> > > >
>> > > >   can anybody help me out to get rid of this issue.
>> > > >
>> > > >   Thanks
>> > > >   Manish
>> > > >
>> > >
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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