PDA

View Full Version : Features Dialog queryExit check



cewolcott
03-28-2006, 02:22 PM
Does anyone have a code snippet to check during the queryExit of the featureDialog to check if atleast one feature was selected? :confused:

I know that I can perform the following:

context.setReturnValue(false);

to stop the progression of the dialog, but I am confussed on how to iterate over the features to check if any are active.

enanrum
03-29-2006, 10:48 AM
public void queryExitFeature(com.installshield.event.ui.ISDialogQueryContext arg0)
{
try{
if(arg0.resolveString("$P(BeanIDOfFeaure.active)").equalsIgnoreCase("true")){
// feature is selected!
}else{
// feature not selected
}
}catch(Exception e){
LogUtils.getLog().logEvent(this, Log.ERROR, e);
}
}

Obviously you could put all in something like:
'if (featureA.active(true) || featureB.active(true) || ...){ then 1 is selected!}

Regards,
Tom

cewolcott
03-29-2006, 12:21 PM
Thanks. This will work for now. :)

I was actually looking for something more dynamic. So as I added new features I wouldn't have to go change the code. My thought was to go throught the product tree and get the features and then ask the features if there are visible and active. I just do not know where to start.