Hi wera,
If you have control over the button in the host page, you should probably
include it as part of the widgets in your GWT application to
programmatically add the GWT component you want to display when the button
is clicked from within your GWT code. You could potentially do something
like:

Button addGwtComponent = new Button("Add my widget!");
addGwtComponent.addClickHandler(new ClickHandler() {
  @Override
  public void onClick(ClickEvent event) {
    RootPanel.get("gwcontainer").add(myGwtComponent);
  }
});

You can even take this further if you have control over whether the <div> is
necessarily in the first place, in which case you can just add
myGwtComponent to a panel that may have previously not displayed anything.

If you don't have control over elements in the page, you could expose an
initialization bridge method that would execute something similar to the
RootPanel.get("gwcontainer").add(myGwtComponent) mentioned above. Check out
the FAQ below for more details on how to expose a bridge method:

http://code.google.com/webtoolkit/doc/1.6/FAQ_Client.html#How_do_I_call_Java_methods_from_handwritten_JavaScript_or_third

Hope that helps,
-Sumit Chandel




On Sun, May 3, 2009 at 11:27 AM, wera <svet...@gmail.com> wrote:

>
> Hi,
>
> I've got HTML page that contains
>
>  + some content
>  + div
>  + button
>
> A click on button should create Ajax request and on success add GWT
> component to Div (replace it with the content that returned from
> server).
>
> I thought that when I add includes of GWT scripts to DOM, it would
> reload a GWT component.
> But it doesn't work correctly. Is there another way to do it?
>
>
> thanks!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to