If you know the ID of an element, you can get it by:

Document.get().getElementById(CONTENT_DIV_ID);

Cheers,
Kevin

On Oct 26, 11:18 am, laredotornado <[email protected]> wrote:
> Hi,
>
> I'm using GWT 2.4.  I have a click handler attached to a button.
> Within the handler, I make an ajax call that returns HTML.  I wish to
> populate the innerHTML of a div, given the element's "id", but I'm not
> sure how to do that.
>
> Any suggestions?  I'm currently working with ...
>
>           public void onSuccess(String result) {
>                   final DivElement contentDiv = (DivElement)
> getWidgetById(CONTENT_DIV_ID);
>                   contentDiv.setInnerHTML(result);
>           }
>         });
>
> The above currently gives the compile error "Cannot cast from Widget
> to DivElement".  Thanks, - Dave

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