cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
John_Cook
Level 2

Cancel Button does not Work in Custom Dialog

Help!

I created a custom dialog, based on the "Cancel" dialog. My custom Dialog is called "AlreadyInstalled". I successfully added the custom dialog to my pre-install wizard sequence, and I successfully added the condition to the dialog to make it appear at the correct time.

When I specialized this dialog, i was able to set its title properties OK and to add the text label properties I wanted. The dialog already comes with the cancel button, which is what I wanted.

However, when testing this dialog during actual installs, the cancel button does not work. If I click it, it changes color (like a button press), but no event seems to be firing.

I could not find anything about the need to hook an event handler into this dialog. I have tried a couple of things, but they do not work. Here is my current code:

_____________________________________

package com.installshield.microsoft_html_help_binaries_for_oid.event.dialog.console;

import java.io.*;
import java.net.*;
import com.installshield.event.*;
import com.installshield.event.ui.*;
import com.installshield.event.wizard.*;
import com.installshield.event.product.*;
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.awt.*;
import com.installshield.wizard.swing.*;
import com.installshield.wizard.console.*;
import com.installshield.product.*;
import com.installshield.util.*;
import com.installshield.ui.controls.*;
import com.installshield.database.designtime.*;

public class PanelAlreadyInstalledConsoleImpl
{

public void queryExitAlreadyInstalled(com.installshield.event.ui.ISDialogQueryContext arg0)
{
SwingWizardUI consoleUI = (SwingWizardUI )arg0.getWizardUI();
consoleUI.cancelAction();
}
}

_____________________________

package com.installshield.microsoft_html_help_binaries_for_oid.event.dialog.swing;

import java.io.*;
import java.net.*;
import com.installshield.event.*;
import com.installshield.event.ui.*;
import com.installshield.event.wizard.*;
import com.installshield.event.product.*;
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.awt.*;
import com.installshield.wizard.swing.*;
import com.installshield.wizard.console.*;
import com.installshield.product.*;
import com.installshield.util.*;
import com.installshield.ui.controls.*;
import com.installshield.database.designtime.*;

public class PanelAlreadyInstalled
{
public void buttonClickedcancel(ISControlContext context) {

SwingWizardUI wizardUI = (SwingWizardUI)context.getWizardUI();
wizardUI.cancelAction();
}

public void initializeUICancel(ISDialogFrameContext context) {
ISFrame frame = context.getISFrame();

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

}

}

___________________________

Thanks!
John Cook
Labels (1)
0 Kudos
(2) Replies
enanrum
Level 9

I do not think you need to add any code for the canel button in your custom dialog! It's inherited from whatever Category you created your dialog in ie:

Begin
Cancel
Finish
Main
etc...

What happens if you just remove all the code for the Cancel Button and try rerunning it!!!


Regards,
Tom
0 Kudos
Jennell_Little
Level 3

I had a problem that sounds similar to this. I fixed it by editing FrameCancel.java and changed cancelAction() to doCancel().
0 Kudos