Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

SdAskOptionsList() without defaults [ISPro 6.31]


1 reply to this topic

Shaitan00

Shaitan00
  • Full Members
  • 5 posts

Posted 23 October 2006 - 19:14

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...

CODE

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,

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 25 October 2006 - 02:24

I played around with your code and it seems that the exclusive setting on a dialog listing will always force the first option to be selected.

With the nonexeclusive setting enabled, it works as would have expected. Especially since you state that more than one option can be selected.

If you must use the exclusive setting though, then I guess you'll have to include a dummy initial value to workaound that limitation.
user posted image