I modified the code as:

HTML code to :

<li><a href="#" onclick="controlRoom('test');">CONTROL ROOM</a></li>

GWT code to :

        public static native void test() /*-{
                $wnd.controlRoom = function(myvariable) {
                        @com.Test.client.TestClass::onClickControlRoom();
                };
        }-*/;

but still my onClickControlRoom function is not being called. Anything
I am missing?

On Sep 23, 9:59 pm, Allahbaksh Asadullah <[email protected]>
wrote:
> Hi,
> You could simply use JSNI it would be much easier to do this. I am not
> sure about syntax. But I have tried these thing previously and it
> works.
> Regards,
> allahbaksh
>
> Declare a JSNI function
>
> <a href="#" onClick="abc('test');">Control Room</a>
>
> public static native void test()/*
>
> {
>
> $wnd.abc = function(myVariable){
> //Call Java method with myVariable passed
>
> return false;
>
> }
> }
>
> On Sep 23, 9:16 pm, Trevis <[email protected]> wrote:
>
> > Wow.  Mixing custom html and GWT looks painful.   I would never do
> > this.  I'll be curious to see if someone clears up how to make this
> > work.
>
> > On Sep 23, 3:41 am, newUser <[email protected]> wrote:
>
> > > Hi All,
>
> > > I am a newbie here so please excuse me if I write a silly question.
>
> > > I have a html code like:
>
> > > <div id="navhome">
> > >         <ul>
> > >           <li><a href="Home.html">HOME</a></li>
> > >         </ul>
> > > </div>
> > > <div id="navcontrol">
> > >         <ul>
> > >           <li><a href="">CONTROL ROOM</a></li>
> > >         </ul>
> > > </div>
>
> > > Now, what i want to do is, whenever the user clicks on the "control
> > > Room" link (as above), only some part of the web page is updated.
> > > However, i am unable to catch the click event on the "Control Room"
> > > link. What I have tried is :
>
> > > DOM.sinkEvents(DOM.getElementById("navcontrol"), Event.ONCLICK);
> > >                 DOM.setEventListener(DOM.getElementById("navcontrol"), new
> > > EventListener() {
> > >                         public void onBrowserEvent(Event event) {
> > >                                 mainPanel.setSize("10px", "10px");
> > >                         }
> > >                 });
>
> > > Can someone help me identify the mistake? Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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