On Sep 3, 6:22 pm, Rich MacDonald <[EMAIL PROTECTED]> wrote:

> ... Since all those generic
> element objects are subclasses of dom.client.Element, not
> user.client.Element, you CANNOT use those DOM methods with the
> dom.client.Element subclasses. Seems to me that makes them unusable
> for now.

Happily not so. I finally figured out the cast() voodoo method, which
"converts" the dom.client.Element
instance to a user.client.Element instance. So you can work with
dom.client.Element when possible, then simply
cast() them to user.client.Element when they need to be sent to the
DOM class.

And while I do prefer that getChild, getChildCount, and getChildIndex
methods be implemented in the Node class for convenience,
I was easily able to write my own equivalent methods elsewhere. Here
is an example, where the parameters are dom.client.Element types:

public static int getChildCount(Element elem) {
        return DOM.getChildCount((com.google.gwt.user.client.Element)
elem.cast());
}
--~--~---------~--~----~------------~-------~--~----~
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