Hello,
I have a problem with the DialogBox widget. I saw that there is a topic
about this in the mail list but it's for the older versions of GWT
(prior 1.6).
As I saw from the documentation and also at the source of the DialogBox
it seems that it's not possible adding of a widget to the title bar.
Thats why I tried to extend the dialog box and
to remove the old caption panel and to replace it with a new one. Here
is a snippet from my code that is doing this:
super();
Element td = getCellElement(0, 1);
DOM.removeChild(td, ((UIObject) getCaption()).getElement());
HorizontalPanel vp2 = new HorizontalPanel();
DOM.appendChild(td, vp2.getElement());
adopt(vp2);
vp2.setStyleName("Caption");
HTML label = new HTML("Нов Договор");
Button b = new Button("X");
b.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
NewSchoolContractDialog.this.hide();
}
});
vp2.add(label);
vp2.add(b);
vp2.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_LEFT);
vp2.setCellHorizontalAlignment(b, HasHorizontalAlignment.ALIGN_RIGHT);
vp2.setWidth("100%");
Everything is looking as it has to but the problem is that the
CllickHandler isn't invoked when X button is clicked. I think that the
problem is caused by the original DialogBox. In the constructor of the
DialogBox there are few lines which are registering few mouse events to
the widget which probably is the reason that my handler is not working.
Does anyone know how can I solve it? (Or maybe some better solution,
because this acts as a hack).
Thanks in advance
Regards,
Miroslav
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---