IzPack

Re-enabled button does not gain focus

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.11.0
  • Fix Version/s: 4.1.0
  • Component/s: Installer
  • Labels:
    None
  • Environment:
    Tested on Windows XP and Server 2003
  • Number of attachments :
    0

Description

When the Next Button on a panel is disabled, the Cancel Button gets focus then when the Next Button is enabled again it never receives focus properly. Currently, the requestFocus() method is used and I tried switching it to the requestFocusInWindow() as is advised now, but it does not change focus properly either.

The end result is that end users try and press Enter to progress through the installer and after the installation progress (InstallPanel) they hit enter and the installer just "goes away" leaving a half-baked install. This behavior should be the case for ANY panel that disables the Next Button during the install.

Activity

Hide
Jeff Gordon added a comment -

This is fixed by setting the nextButton as the default button after requesting focus.

Any objections?

  • Jeff

public void unlockNextButton(boolean requestFocus)
{
nextButton.setEnabled(true);
if (requestFocus)
{
nextButton.requestFocusInWindow();
getRootPane().setDefaultButton(nextButton);
if (this.getFocusOwner()!=null) { Debug.trace("Current focus owner: "+this.getFocusOwner().getName()); }
if (!(getRootPane().getDefaultButton()==nextButton)) { Debug.trace("Next button not default button, setting..."); quitButton.setDefaultCapable(false); prevButton.setDefaultCapable(false); nextButton.setDefaultCapable(true); getRootPane().setDefaultButton(nextButton); }
}
}

Show
Jeff Gordon added a comment - This is fixed by setting the nextButton as the default button after requesting focus. Any objections?
  • Jeff
public void unlockNextButton(boolean requestFocus) { nextButton.setEnabled(true); if (requestFocus) { nextButton.requestFocusInWindow(); getRootPane().setDefaultButton(nextButton); if (this.getFocusOwner()!=null) { Debug.trace("Current focus owner: "+this.getFocusOwner().getName()); } if (!(getRootPane().getDefaultButton()==nextButton)) { Debug.trace("Next button not default button, setting..."); quitButton.setDefaultCapable(false); prevButton.setDefaultCapable(false); nextButton.setDefaultCapable(true); getRootPane().setDefaultButton(nextButton); } } }
Hide
Julien Ponge added a comment -

No objection here.

Show
Julien Ponge added a comment - No objection here.
Hide
Julien Ponge added a comment -

The fix shall be committed in the 4.0 branch.

Thanks Jeff!

Show
Julien Ponge added a comment - The fix shall be committed in the 4.0 branch. Thanks Jeff!
Hide
Julien Ponge added a comment -

The issue is rescheduled to 4.1.0 as it could not make it for the 4.0.1 cutoff.

Show
Julien Ponge added a comment - The issue is rescheduled to 4.1.0 as it could not make it for the 4.0.1 cutoff.
Hide
Julien Ponge added a comment -

This issue has been originally scheduled for inclusion in version 4.1.0, to be released on october 2nd 2008.

If you believe that it cannot be resolved on time, then could you please move it to 4.2.0? Otherwise, I would appreciate if you could give me a time frame for scheduling purposes

Thanks a lot!

Show
Julien Ponge added a comment - This issue has been originally scheduled for inclusion in version 4.1.0, to be released on october 2nd 2008. If you believe that it cannot be resolved on time, then could you please move it to 4.2.0? Otherwise, I would appreciate if you could give me a time frame for scheduling purposes Thanks a lot!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: