这里我在getId时遇到了一个窗口的setId问题,以便在循环中检索窗口名称。这是一个片段:
int counter1 =1;
final Integer counter = new Integer(counter1);
windowDoneTextButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
if (counter <= 100) {
window.setId(new Integer(counter).toString());
windowQuestionVerticalLayoutContainer.setId(new Integer(counter).toString());
window.hide();
addItemSplitButton.removeFromParent();
Label questionTitleLabelOfWindowQuestionTextField = new Label();
questionTitleLabelOfWindowQuestionTextField.setText(windowQuestionTextField.getValue());
Label questionHelpTextLabelOfWindowQuestionHelpTextTextField = new Label();
questionHelpTextLabelOfWindowQuestionHelpTextTextField.setText(windowQuestionHelpTextTextField.getValue());
FormPanel editFormPanel = new FormPanel();
HorizontalPanel editHorizontalPanel = new HorizontalPanel();
TextButton editButton = new TextButton();
editButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
addItemSplitButton.removeFromParent();
window.show();
homePageVerticalLayoutContainer.add(window);
homePageVerticalLayoutContainer.add(addItemSplitButton);
}
});