Search code examples
javagwtdialoggxt

How to get Button in GXT


In my application I have a dialog box, which is not created by it's own class, but just added as a widget to the page. I need to add a listener to the button in this box, which is added to the dialogue box like this: dialog.setButtons(Dialog.OKCANCEL); Or how to process the button cklick?

UPD: I use GXT 2.2.


Solution

  • I've found the way to solve my problem. To handle the "ok" button click I needed to do the following:

     addDialog.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    //todo
                }
            });