Mickaël wrote:
> Hello,
> 
> I'm reading the GWT source code and asking myself why the type of img
> parameter is Element
> and not ImageElement ?
> 
> Sample code :
> 
> public static String getImgSrc(Element img) {
>     return img.<ImageElement> cast().getSrc();
>   }
> 
> Is it bound to defered binding ?
> 
> Any response would be appreciated :)


Heya,

I'll assume your referring to the DOM methods. In which case the answer is that 
those are (mostly) 
legacy methods, from before the ImageElement class existed (you'll notice the 
Element class 
getImageSrc takes is a com.google.gwt.user.client.Element and not a 
com.google.gwt.dom.client.Element). In GWT 1.5 and above it's generally a 
better idea to use an 
ImageElement directly and call setSrc() and getSrc() directly on it.

Hope that clears things up a bit ;)
Jason.

--~--~---------~--~----~------------~-------~--~----~
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