On 26 juin, 05:19, bhomass <[email protected]> wrote:
> I know that when calling a java function inside a native function, you
> should add this. in the front. but if this is inside event handler,
> "this." becomes the element who received the event, and there is this
> ambiguity. e.g.
>         private native void addClickListener(Element imgElement)/*-{

var self = this;

>                 imgElement.onclick = function() {
>                         this.style.border = '1px solid blue';
>

[email protected]::highlight(Lcom/
google/gwt/user/client/Element;)(this);

>         };
>         }-*/;
>
> as you can see, the first this. in this.style.border = '1px solid
> blue'; meant imgElement. but the next one in the line below is meant
> to refer the this java class.
>
> how would I refer to this class instance?

See corrections inlined above.
--~--~---------~--~----~------------~-------~--~----~
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