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

Re-Enabling Next Button

Hi -

I'm new to InstallShield and I'm having trouble trying to re-enable the 'Next' button after disabling it during initialization. I want to re-enable the 'Next' button after a user types anything within a text box...this is what I currently have:

private ISFrame frame = null;
private ISButton nextButton = null;

public void initializeUIOracleConnectionDialog(com.installshield.event.ui.ISDialogContext arg0)
{
frame = arg0.getISFrame();
nextButton = frame.getButton(NEXT_BUTTON);
nextButton.setEnabled(false);
}

public void keyTypedSrvHostNameTxt(com.installshield.event.ui.ISControlContext arg0)
{
nextButton.setEnabled(true);
nextButton.refreshExtendedProperties();
}

Anybody know what I need to do so as to see the Next button in an enabled state? Any help would be greatly appreciated.

Thanks,
Paul
Labels (1)
0 Kudos
(3) Replies
tony_flexera
Revenera Community Admin Revenera Community Admin
Revenera Community Admin

Paul,

Give the below a try. It should enable the Next button if there is text in the text field and disable if there is no text.

Tony

public void keyTypedISTextFieldDef1(com.installshield.event.ui.ISControlContext arg0)
{
try
{
ISFrame frame = ((SwingPanel)arg0.getISContainer()).getISFrame();
ISButton nextButton = frame.getButton("next");
ISTextField field = (ISTextField)arg0.getISControl();
String value = field.getText();
if(!value.equals(""))
{
nextButton.setEnabled(true);
}
else
{
nextButton.setEnabled(false);
}
}
catch(Exception e)
{
arg0.getServices().logEvent(this, Log.ERROR, "Caught an exception........");
}
}
0 Kudos
pgarvey
Level 4

Thanks for the help Tony - alas, it didn't work. The Next button is stuck on disabled still...
0 Kudos
pgarvey
Level 4

In case anyone is interested, I finally managed to get this to work. While pulling the last few strands of my hair out, I desperately tried this in an attempt to "jiggle" the button:

if(!value.equals(""))
{
nextButton.setEnabled(true);
nextButton.setEnabled(false);
nextButton.setEnabled(true);
}

Low and behold...it worked. Hope this helps anyone else in the same boat.

Paul
0 Kudos