Hi Mark,
   By default the first Item in the List will be selected when the 
form is loaded. You have to check two possibilities for your problem.

1: Check the List pointer pointing to your List Box (If your ListPtr 
is pointing to any other Object then you will always have 0 as return 
value. - 
  listptr = FrmGetObjectPtr(formPtr, FrmGetObjectIndex
(formPtr,objectIndex)); /* here check the objectIndex to list box*/

2: If the List Box is having first item selected by default, set the 
selection to -1 (i.e ) 
    LstSetSelection(listptr,-1); 
in the form load event.


Thanks,
   Manikumar K
--------------------------------------------------------------------
Developers' Nation
You've got the questions; we've got the answers.
Visit Us At :http://www.devnation.net for Palm Developer Support
--------------------------------------------------------------------


--- In [EMAIL PROTECTED], "Mark Douglas" <[EMAIL PROTECTED]> wrote:
> 
> I am calling LstGetSelection to find the currently selected item in 
a list.
> When I make the call nothing is selected in the list.  I am 
expecting to get
> back "noListSelection" (-1), but I always receive 0 indicating the 
first
> element is selected.  My List is associated with a Trigger, so 
maybe that
> has something to do with it.
> 
> Has anyone else encountered this?  I'm not sure how to mandate a 
selection
> in the list without the proper return value.
> 
> I have coded as follows:
> 
>     iSelected = LstGetSelection( GetObjectPtr
(RFSDetailServiceClassList));
>     if(iSelected == noListSelection) {
>          FrmCustomAlert(SayAnythingAlert, "Service Class not 
Selected.
> Please Select from the available Choices.", " ", " ");
>          FrmSetFocus (pFrm, FrmGetObjectIndex(pFrm,
> RFSDetailServiceClassList));
>          return (false);
>     }
> 
> Thanks,
> Mark Douglas
> 
> 
> 
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to 
unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to