Results 1 to 3 of 3

Thread: How to get an Id of a widget in GXT

  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
      0  

    Default 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); } });

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Answers
    20
    Vote Rating
    21
      0  

    Default

    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.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
      0  

    Default 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);
                                }
                            });

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •