2012-05-14 3 views
1

я следующая иерархия Группы:Закрытие всплывающей панели, нажав на кнопку в детской панели

пользовательских настройки панель 1 содержит PopupPanel содержит DecklayoutPanel содержит CustomPanel 2 содержит FlowPanel содержит Кнопка.

Как закрыть пользовательскую панель 1 или PopupPanel, нажав кнопку?

ответ

1

// CustomPanel2

class CustomPanel2 { 
    @UiField Button closeButton; 

    public CustomPanel2() { 
    initWidget(uiBinder.createAndBindUi(this)); 
    } 

    public HasClickHandlers closeButton() { 
    return closeButton; 
    } 
} 

// CustomPanel1

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(); 
    } 
} 
Смежные вопросы