Author Topic: GetListboxSelection always returns -1  (Read 3620 times)

jahme

  • Guest
GetListboxSelection always returns -1
« on: February 02, 2007, 04:36:59 pm »
Hi,

I'm trying to write a wizard.script file for my company, but I'm having trouble with GetListboxSelection function it keeps returning -1.

The function I have implemented passes the selected list item into the variable boardChoice see below.

"function OnLeave_JennicBoardSelection(forward)
   {
     if (forward)
        {
           boardChoice = Wizard.GetListboxSelection(_T("JennicBoardSelection"));
        }
        return true;"

The implementation of the page is done here;
"//Page to select the board that you are developing on from a list
        Wizard.AddGenericSingleChoiceListPage(_T("JennicBoardSelection"), descr, _T("DK1;DK2;NTS;HighPowerDevelopmentKit"), 1);"

Any Ideas, apologies if I posted on the wrong forum.

Regards Jahme

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: GetListboxSelection always returns -1
« Reply #1 on: February 02, 2007, 04:45:11 pm »
Change the following code-
Code
boardChoice = Wizard.GetListboxSelection(_T("JennicBoardSelection"));
To
Code
boardChoice = Wizard.GetListboxSelection(_T("GenericChoiceList"));

You are getting -1 as the ListBox name in AddGenericSingleChoiceListPage is GenericChoiceList  :)
Be a part of the solution, not a part of the problem.

jahme

  • Guest
Re: GetListboxSelection always returns -1
« Reply #2 on: February 02, 2007, 06:44:10 pm »
Great that works!

I could not find any reference to GenericChoiceList in the documentation.

Thanks for the help  :D

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: GetListboxSelection always returns -1
« Reply #3 on: February 02, 2007, 06:47:30 pm »
I could not find any reference to GenericChoiceList in the documentation.

I agree with you. I had to struggle with this issue once. I'll update the wiki later.

Thanks for the help  :D

You are most Welcome.  :)
Be a part of the solution, not a part of the problem.