【发布时间】:2012-05-14 05:15:41
【问题描述】:
我有以下面板层次结构:
自定义面板 1 包含 PopupPanel 包含 DecklayoutPanel 包含 CustomPanel 2 包含 FlowPanel包含按钮。
如何通过单击按钮关闭自定义面板 1 或 PopupPanel?
【问题讨论】:
标签: gwt popuppanel
我有以下面板层次结构:
自定义面板 1 包含 PopupPanel 包含 DecklayoutPanel 包含 CustomPanel 2 包含 FlowPanel包含按钮。
如何通过单击按钮关闭自定义面板 1 或 PopupPanel?
【问题讨论】:
标签: gwt popuppanel
// 自定义面板2
class CustomPanel2 {
@UiField Button closeButton;
public CustomPanel2() {
initWidget(uiBinder.createAndBindUi(this));
}
public HasClickHandlers closeButton() {
return closeButton;
}
}
// 自定义面板1
class CustomPanel1 implements ClickHandler {
@UiField PopupPanel myPopupPanel;
@UiField CustomPanel2 customPanel2;
public CustomPanel1() {
initWidget(uiBinder.createAndBindUi(this));
customPanel2.closeButton().addClickHandler(this);
}
@Override
public void onClick(ClickEvent e) {
myPopupPanel.hide();
}
}
【讨论】: