Results 1 to 4 of 4

Thread: The method getHideButton() is undefined for the type Dialog

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    32

    Default The method getHideButton() is undefined for the type Dialog

    missing this method:
    problem in code :

    box.addHideHandler(new HideHandler() {

    @Override
    public void onHide(HideEvent event) {
    Dialog btn = (Dialog) event.getSource();
    if (PredefinedButton.valueOf(btn.getHideButton().getItemId()).equals(PredefinedButton.YES))
    controller.deleteCar();
    }
    });

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737

    Default

    As documented in the release notes and in Dialog's Javadoc, there is now a better event to get these details from called DialogHideEvent. With this event, it isn't necessary to track the last button used to hide the dialog. Several reasons this is a good thing:
    * Hard to tell if a dialog was hidden via hide(), since that means no button
    * The button returned from getHideButton() had to be checked to see if it had a certain string to decide on what action to take instead.

    Release notes excerpt:
    • Removed Window.hide(TextButton) and Window.getHideButton(), these capabilities are now provided by the derived class, e.g. Dialog.addDialogHideHandler() and DialogHideEvent.getHideButton()
    • Added Dialog.getButton(PredefinedButton) as an alternative to Dialog.getButtonById(String)

    Example from dialog javadocs:
    Code:
       dialog.addDialogHideHandler(new DialogHideHandler() {
         @Override
         public void onDialogHide(DialogHideEvent event) {
           // Invoke event.getHideButton() and take action based on value of returned enum
         }
       });

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    6

    Default

    That's what I was looking for... Thanks!

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2007
    Posts
    79

    Default

    Just the tip I needed too - also thanks!

Posting Permissions

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