In this case the system does the whole job for you. You just have to set the
trigger label text and afterwards get a pointer to the changed label text.
You don't need code to trigger and hide the popup list.

1. In the resource editor (i.e. constructor) attach the list to the popup
trigger
2. In the code assign a dynamic array to the list in the FormInit routine.
     lst = GetObjectPtr (MainList);
     // load popup list with db records
    (loop through records to load array...)

     LstSetListChoices (lst, &listItems[0], numRecords);
     LstSetHeight (lst, visibleRows);
     LstSetSelection (lst, currentRow);
     FrmDrawForm (frm);
3. In the FormHandleEvent routine get the changed label text
    case ctlSelectEvent:
       switch (event->data.ctlSelect.controlID) {
        case MainOKButton:
           str = CtlGetLabel (GetObjectPtr (MainListPopTrigger));

and that's all you have to do!



"Jayakody, Dhanushka" <[EMAIL PROTECTED]> wrote in message
news:82544@palm-dev-forum...
>
> Hi,
>
> I have a dynamically generated list which is assigned to a popUp trigger .
> This is the way how i display the list .
>
> // The ListID is attached to the PopUpTrigger at Design time.
>
> case MyPopTrigger:
> InitMainForm();  // This func populated the list dynamically.
> frm = GetActiveFrom();
> list = FrmGetObjectPtr(frm,FrnGetObjectIndex(frm,DynamicList));
> LstPopUpList(lst);
>
> break;
>
> This draws the List when i click on the PopUpTrigger.  But I cant select
it
> again only once i can do it. Also I dont know how to get the the text of
the
> selected item fom the popup list (is it lstSelectEvent/PopSelectEvent with
> some func() to retrieve the value).
>
> Can some one tell me which is the best way to dynamically load the list
and
> get the selected item text on to another variable.
>
> Thanks in Advance
>
> Dhanushka.
>
>
>
>
>



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

Reply via email to