PDA

Click to See Complete Forum and Search --> : SdAskOptionsList() without defaults to force a selection [InstallShieldPro 6.31]


Shaitan00
Oct 23rd, 2006, 03:23 PM
Simply put I want to display an OptionList (using SdAskOptionList) without any defaults to force the user to select one before he can press NEXT.
The idea is to provide a list of options to the user but have the NEXT button disabled until at least ONE of the options are selected - which in turn means that when we first display the list none of the options should be selected...


for nCurrent = 0 to nSize
// ... do some work to get sValue corresponding to this nCurrent ...
ComponentAddItem("CustomSetNameList", sValue, nCurrent, FALSE);
endfor;


Disable(BACKBUTTON);
Disable(NEXTBUTTON);
sTmp = MEDIA;

Disable(DIALOGCACHE);
MEDIA = "CustomSetNameList";
nRetVal = SdAskOptionsList("Step 5 - Identification", "Please select the"+
" proper name.", "", EXCLUSIVE);
MEDIA = sTmp;
Enable(DIALOGCACHE);
Enable(NEXTBUTTON);


Root problem is - during install sometimes people just click next,next,next,etc... but at this stage I want to FORCE the user to select something from the list.
Therefore I need to ensure there is NO default and I need to ensure that the NEXT button is disabled until one of the options are selected...

I can't seem to figure out what is wrong with my above-code, I did some reading and I thought that setting "ComponentAddItem("CustomSetNameList", sValue, nCurrent, FALSE);" when adding the value to the Component would solve the DEFAULT problem (as bSelected is FALSE for all items) but this doesn't seem to work, when I run it the 1st option on the list is always checked...

Any help would be greatly appreciated...
Thanks,