construct all your elements on the page with the gwt widgets and
panels, add the main panel to the root and the clicklisteners should
be working :-)

go away from coding html directly in gwt.

On 22 Aug., 13:06, LFCPD <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm desperate and need your help! In my application I have a DialogBox
> and in the header I want to set an image (an 'x') that when is clicked
> the DialogBox must be closed. I create the image, as you can seen in
> the code below, and transform the code into an string to set in the
> header. But when I click on the 'x', nothing happens. Any idea?
>
> final Image closeWindowImg = new Image();
> closeWindowImg.setSize("13pt", "13pt");
> closeWindowImg.addClickListener(new ClickListener() {
>         public void onClick(final Widget sender) {
>                 System.out.println("img clicked!!!!!!!!!!!!!");
>                 Window.alert("img clicked!!!!!!!!!!!!!");
>                 hide();
>         }});
>
> closeWindowImg.setStyleName("gwt-Image-close");
> closeWindowImg.setUrl(GWT.getModuleBaseURL() + "images/close.gif");
>
> String x = closeWindowImg.getElement().toString();
> String header = "<b class=\"b1f\"></b><b class=\"b2f\"></b><b class=
> \"b3f\"></b><b class=\"b4f\"></b>" +
>                                 "<div class=\"contentf\">" +
>                                         "<div class=\"title\">Reload 
> Network</div>" +
>                                         "<div class=\"x\">" + x + "</div>" +
>                                 "</div>";
> setHTML(header);
>
> Thanks a lot!!!!!
>
> Laia
--~--~---------~--~----~------------~-------~--~----~
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