method "On Application Start"
        `need to create the global collection, cFormSelects, for forms

                cFormSelects:=new global collection

array string(255;$aReqTypes;0)
set array($aReqTypes;"Medical", "School Business", "Personal", "Comp.",
"Funeral")
cFormSelects{"ReqTypes"}:=$aReqTypes


end method

cFormSelects sure looks like a process variable to me, which don't do you much good in subsequent requests, which are in other processes.


Try this:

   c_longint($c)
   $c := new global collection
   [snip]
   $c{"ReqTypes"} := $aReqTypes
   globals{"cFormSelects"} := $c

The last line is the crucial one.

Then elsewhere you reference the collection from the globals via globals{"cFormSelects"}.

But this begs the point -- your "BuildSelect" method is just reinventing the wheel. I have a bunch of methods in a4d.web for building select menus.

In your library mylib.a4l, do this:

define(kFormSelects; "Medical;School Business;Personal";Comp.";Funeral")

Then in your page you do this, assuming you want to default to the first value:

  import("a4d.web")
  a4d.web.BuildSelectMenu(mylib.kFormSelects; 1; "")

Hey everybody! Please take a close look at a4d.web and a4d.utils. There is a lot of useful stuff in there!

Regards,

   Aparajita
   Victory-Heart Productions
   [EMAIL PROTECTED]
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com



Reply via email to