-
7 Mar 2013 12:46 AM #1
Unanswered: How to get an Id of a widget in GXT
Unanswered: How to get an Id of a widget in GXT
here I got a problem with the setId of a window at the time of getId in order to retrieve the window name in a loop. Here is a snippet:
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); } });
-
7 Mar 2013 9:26 AM #2
Would you mind editing your post and using the #-button in the tool bar to wrap it in CODE tags so that we can read this a little easier? It would also make helping you easier. Thanks.
-
7 Mar 2013 8:04 PM #3
How can refer a widget by using getId
How can refer a widget by using getId
Code:int counter1 =1; final Integer counter = new Integer(counter1); if (counter <= 1000) { windowDoneTextButton.addSelectHandler(new SelectHandler() { @Override public void onSelect(SelectEvent event) { windowQuestionVerticalLayoutContainer.setId(new Integer(counter).toString()); window.hide(); addItemSplitButton.removeFromParent(); final FormPanel editFormPanel = new FormPanel(); editFormPanel.setId(new Integer(counter).toString()); editFormPanel.setPosition(560, 0); TextButton editButton = new TextButton(); TextButton copyButton = new TextButton(); TextButton deleteButton = new TextButton(); editButton.setText("Edit"); editButton.addSelectHandler(new SelectHandler() { @Override public void onSelect(SelectEvent event) { System.out.println(editFormPanel.getId()); System.out.println(windowQuestionVerticalLayoutContainer.getId()); if(editFormPanel.getId().equals(windowQuestionVerticalLayoutContainer.getId())) { // windowQuestionVerticalLayoutContainer.removeFromParent(); // windowQuestionVerticalLayoutContainer.sremove(windowQuestionVerticalLayoutContainer); windowQuestionVerticalLayoutContainer.remove(Integer.parseInt(windowQuestionVerticalLayoutContainer.getId())); } // windowQuestionVerticalLayoutContainer.getId(); window.show(); centerContentHomePageVerticalLayoutContainer.add(window); } });


Reply With Quote