프로그래밍 초보자입니다.Gwt의 PopupPanel에 취소 버튼을 추가하는 방법
세로 패널이 있습니다. 버튼 (lblAddFolderIcon)이 verticalPanel 및 일부 위젯에 추가되었습니다.
b1을 클릭하면 추가 위젯이있는 팝업 패널과 추가 및 취소 버튼이 있어야합니다.
내 코드 :
lblAddFolderIcon.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
String childFolder = item.getText();
String[] mainRepository=getPath(item);
String objectId=item.getTitle();
final AddFolderPopup addFolderPopup = new AddFolderPopup(childFolder,mainRepository[0],objectId);
addFolderPopup.setHeight("300px");
addFolderPopup.setWidth("502px");
addFolderPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
// TODO Auto-generated method stub
int left = (Window.getClientWidth() - offsetWidth)/3;
int top = (Window.getClientHeight() - offsetHeight)/3;
addFolderPopup.setPopupPosition(left, top);
}
});
//addFolderPopup.show();
addFolderPopup.addFolderGui();
}
});
public class AddFolderPopup extends PopupPanel {
VerticalPanel vpPopupl = new VerticalPanel();
private String childFolder;
private String mainRepository;
private String objectId;
public AddFolderPopup(){
super(true);
}
public AddFolderPopup(String childFolder, String mainRepository, String objectId) {
this.childFolder = childFolder;
this.mainRepository = mainRepository;
this.objectId = objectId;
}
public void addFolderGui() {
// some widget to design Gui and
Button btnCancel = new Button("Cancel");
btnCancel.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
/* i Dont Know what should i write here
so that this popupwindow is closed
*/
}
});
}
}
Plz은이 팝업 창을 내 접근 방식이 정확한지도 여부를 를 닫 몇 가지 코드를 제시한다.) ( AddFolderPopup.this.hide;
팝업 패널의 취소 버튼은 무엇입니까? 당신은 정말로 대화 상자를 원하지 않습니까? – milan
다시 화면에 나타나는 창문이되어야합니다. 대화 상자가 필요를 만족 시킨다면 괜찮을 것입니다. – NewCodeLearner