Reputation: 309
I need to add button in title bar of the DialogBox that open some documentation;
My HelpButton class looks like this:
public class HelpButtonSmall extends Button {
public HelpButtonSmall(final String name) {
super();
setHTML("<input type=\"image\" src=\"/img/ico-help-sm.png\" name=\"image\">");
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Help");
}
});
}
}
On my dialog box I'm adding button in title bar like this:
HTML caption = ((HTML)this.getCaption());
HelpButtonSmall smallButton = new HelpButtonSmall("Show help alert");
caption.getElement().appendChild(smallButton.getElement());
The problem is that after clicking on button alert message doesn't show.
Please help me resolve this issue.
Upvotes: 0
Views: 177