Back in Sept there was a post on global collections. The final
post was: <http://www.mail-archive.com/active4d-
[EMAIL PROTECTED]/msg02625.html>
Is this the way to do it or am I still missing something?
In waiting page code:
$savedFormCollection := copy collection(_form;*)
session{"formCollectionHandle"} := $savedFormCollection
In SearchResults page code
$savedFormCollection := session{"formCollectionHandle"}
$searchValue := $savedFormCollection{"f_pmSearchValue"}
$searchImagesOnly := collection has
($savedFormCollection;"f_pmSearchImagesOnly")
$searchComparator := $savedFormCollection
{"f_pmSearchComparator"}
That looks correct.
I'm trying to implement something similar, breaking a large form
into three parts and using session to store the first two parts.
I've got it working, but am concerned with what I read in the manual.
Note: Once you create a global collection, it is your
responsibility to delete it when it
is no longer needed.
and
Warning: Be sure to store the handle in a place where you can
retrieve it later, such
as in the globals collection.
Where does $savedFormCollection reside? I looked for it in Globals
but it does not show up. Does "on session end" take care of
clearing it since it is put in the session?
In the example above, $savedFormCollection was saved in the session,
so it is your responsibility to clear it in On Session End.
The only other global that I've defined was one on application
start with set global. I can get to that, but not sure I understand
the difference between "set global" and "copy collection" with a
global flag.
'set global' (or better, globals{"foo"} := <something>) sets a single
value in the built in globals collection.
copy collection($c; *) copies $c and the copy is a global collection.
In short, don't mix up the terminology -- the globals collection is a
single built in collection maintained by Active4D, whereas a global
collection is the general term for a collection you create that
persists beyond the current request.
If in the example from Sept, I don't have to delete
$savedFormCollection, that's fine, just don't quite understand.
You do have to delete it in On Session End.
Regards,
Aparajita
www.aparajitaworld.com
"If you dare to fail, you are bound to succeed."
- Sri Chinmoy | www.srichinmoylibrary.com
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/