by
allistar >> Tue, 17 May 2005 8:44:26 GMT
I assume you want to do this for performance reasons.
Have you tried converting the recursive code to be procedural and seeing what the performance improvement is?
I doubt very much you'll be able to easily copy a ListBox object, and I'm sure that controls can't exist on more than one form at a time (meaning using a shared transient won't work).
A god way of greatly improving performance on the load of large recurive structures into a list box (or combo box for that matter) is to only load the top level. Put place holder items under each parent item that has children (so you see the "+" symbol. When a parent is expanded you then remove the placeholder item and populate the direct children of this parent from the database.
This has advantage and disadvantages:
- advantage: Greatly improves form load time
- advantage: supports infinite recursive structures
- disadvantage: list box initially has all items unexpanded.
Another option is to create and populate the list box at login time and then copy the itemText and itemLevel arrays to transient collections stored on some ransient singleton object. The when disp;laying a form with this istbox copy those transient arrays to the corresponding arrays on the listbox on the form. I'm not sur is JADE lets you copy into those arrays, but I don't see why not.
Regards,
Allistar.
--
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst
allistar@silvermoon.co.nz
Auckland, NEW ZEALAND
Silvermoon Software
Specialising in JADE development and consulting
Visit us at:
http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at:
www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------