PDA

View Full Version : Events never get triggered!



mplanchart
03-28-2006, 06:37 PM
Hi,

Events never get triggered!

Why?

For example:

The following code is an event that should occur after the combo box has changed selected value:

This never gets triggered, as well as almost every other event. Why?

public void selectionChangedISComboBoxProvisioningImplementation(com.installshield.event.ui.ISControlContext arg0)
{
ISPanel panel = (ISPanel)arg0.getISContainer();
ISFrame frame = panel.getISFrame();

ISTextField wTextField0 = frame.getTextField("ISTextField_TEST");
wTextField0.setText("Hit Event!");

ISComboBox wComboBox0 = frame.getComboBoxControl("ISComboBoxProvisioningImplementation");

String wCBSelectedValue = wComboBox0.getSelectedValue();

ISButton nextButton = frame.getButton(NEXT_BUTTON);
nextButton.setEnabled(false); //Must normally be set to false

ISRadioButton wRadioButton0 = frame.getRadioButton("ISRadioButtonProvisioningType_Simple");
ISRadioButton wRadioButton1 = frame.getRadioButton("ISRadioButtonProvisioningType_Advanced");

ISFlowLabel wFlowLabel0 = frame.getFlowLabelControl("ISFlowLabel_ProvisioningType");

if (wCBSelectedValue == "Computer Associates eTrust") {
wRadioButton0.setEnabled(false);
wRadioButton1.setEnabled(false);
wFlowLabel0.setEnabled(false);
}
else
{
wRadioButton0.setEnabled(true);
wRadioButton1.setEnabled(true);
wFlowLabel0.setEnabled(true);
}
}

aruizf
03-29-2006, 04:56 AM
Hi,

How do you know that the event is not being triggered? Maybe the code in the event is not working... (just a guess). You could try adding something like:

arg0.getWizard().getUI().displayUserMessage("Title", "Error Message", UserInputRequest.ERROR);

at the beginning of the event (this will work for sure).

If you're having trouble with all the events, maybe you should check that you have write access to every file under "CustomCode" (I had trouble with this before, using VSS to keep my code. IS won't tell you if it's not being able to write to the file, and everything will compile smoothly as it's unchanged).

Hope this helps.

Andrés Ruiz

mplanchart
03-29-2006, 12:54 PM
Hi Andrés,

Your suggestion worked! Now I know when an event is being triggered or not.

I am trying to figure out the following:

This is the event that I am trying to manage:

public void selectionChangedISCBP(com.installshield.event.ui.ISControlContext arg0)
{
ISPanel panel = (ISPanel)arg0.getISContainer();
ISFrame frame = panel.getISFrame();
ISComboBox wComboBox0 = frame.getComboBoxControl("ISComboBoxProvisioningImplementation");
wCBSelectedValue = wComboBox0.getSelectedValue();
}

What could this have wrong? Lack of casting?

I appreciate any help!

Thanks

aruizf
03-30-2006, 04:29 AM
Try this:

public void selectionChangedISCBP(com.installshield.event.ui.ISControlContext arg0)
{

wCBSelectedValue = new String();

wCBSelectedValue = arg0.getISPanel().getComboBoxControl("ISComboBoxProvisioningImplementation").getSelectedValue();

}

If you need to use the variable inside in other parts of the installer, you should use something like:
arg0.getServices().getISDatabase().setVariableValue("WCBSELECTEDVALUE", wCBSelectedValue );

Then, you can resolve the variable from anywhere.

I hope this helps.