cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sumitpendharkar
Level 4

Cancel button in custom dialog doesnt work

I have added a new Cancel dialog based on the Cancel frame, the Cancel button (the only one) on it doesnt work, I need to click the X to close the install wizard. I have created few other custom dialogs, all with the same result. Are suggestions on how to fix this problem? Thx.
Labels (1)
0 Kudos
(2) Replies
mgaredia
Level 4

Make sure custom dialog belongs to separate Frame group. Then add following code to Swing event of Frame. In this case I only support Back and Cancel. Same way you can add code for Next Button if you wish.

public void buttonClickedback(com.installshield.event.ui.ISControlContext arg0)
{
SwingWizardUI wizardUI = (SwingWizardUI)arg0.getWizardUI();
wizardUI.doPrevious();
}

public void buttonClickedcancel(com.installshield.event.ui.ISControlContext arg0)
{
SwingWizardUI wizardUI = (SwingWizardUI)arg0.getWizardUI();
wizardUI.doCancel();
}

public void initializeUIDisableButton(com.installshield.event.ui.ISDialogFrameContext arg0)
{
ISFrame frame = arg0.getISFrame();

ISButton backButton = frame.getButton("back");
if (backButton != null) {
backButton.setEnabled(true);
}

ISButton cancelButton = frame.getButton("cancel");
if (cancelButton != null) {
cancelButton.setEnabled(true);
}
0 Kudos
enanrum
Level 9

I know this is an old thread but I was having this issue as well and didn't feel like creating a new frame - please correct me if I'm wrong but the following seems to work fine.

Select the Cancel Frame and change the buttonClickedCancel method from:

wizardUI.cancelAction() to wizardUI.doCancel()

Regards,
Tom
0 Kudos