Hi,

I have a button with a ClickHandler which onClick will create an HTML
element that is placed on a panel. The HTML element will have a
ClickHandler as well which for now just does an alert(). I cant get
this alert to work though. Below is the code. The only reason I can
think of that it doesn't work is because this HTML element is cast to
Widget when placed on the panel (because panel.add() only accepts
widgets) and widgets don't have clickhandlers. If so, how can I
resolve this? Any other reasons why it may not work?

Also note that I am using the connectors API.

Thanks


      Button button = new Button("Test",
                new ClickHandler()
                {
                    public void onClick(ClickEvent event) {
                        HTML html = new HTML();
                        html.addClickHandler(new ClickHandler() {
                            public void onClick(ClickEvent ev) {
                                Window.alert("test");
                            }
                        });
                        panel.add(html, 2, 2);
                        Shape shapeForLabel = new
Shape(html);         //connectors code
 
shapeForLabel.showOnDiagram(diagram);         //connectors code
                    }
                });

-- 
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-tool...@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