Sorry, my feature request was not well thought-out. By the time you let the template parse the HTML it's going to already need the widgets. Better to do what I think you're implying:
* Step 1: create the template with an HTML string or setHTML on an existing template * Step 2: create your widgets and add them both to an array and to the template. * ... * Step 3: RemoveAllChildren on the template * Step 4: setHTML on the template with the new HTML * Step 5: discover which widgets are still needed with getFieldNames * Step 6: Re-add those widgets that are needed, destroy the rest That seems water-tight as far as memory mgmt goes, right? --JYL > --- Jacob Levy <[EMAIL PROTECTED]> wrote: >> Is there a way to find out what named javascript >> objects a template will >> need? > > I think such a feature would be useful. I think I can > add something like getFieldNames(). > >> Itd be nice to keep those around (rather than >> having to recreate >> them) if the template changed in a way that simply >> moved some of the >> existing elements to new locations. > > IMO you can create the objects, store them in an array > then use removeAllChildren() to remove them from the > template before you change the template with > setHTML(). When they're need you can then add them to > the template. > > -- > Raymond Irving >> With such an API I can write a loop that destroys >> those children that will >> no longer be needed. >> >> --JYL >> >> > --- Jacob Levy <[EMAIL PROTECTED]> wrote: >> > >> >> Is it possible to update the template after its >> set? >> > >> > Yes >> > >> >> That is, let's say I >> >> get another template from the server and then do >> >> tmpl.setHTML(newHTML), >> >> will that update the layout to the new template? >> Any >> >> other requirements so >> >> as not to leak memory (like destroying something >> >> before calling setHTML >> >> again)? >> > >> > Once you call setHTML() it will replace content of >> the >> > Template those removeing the elements of the >> > DynLayers, etc. For best use call clearTemplate() >> to >> > deleteAllChildren from the template before >> changing >> > the content. this will prevent memory leaks. >> > >> >> >> >> Thanks! --JYL >> >> >> >> >> >> >> >> >> >> >> >> >> > >> > ------------------------------------------------------- >> >> This sf.net email is sponsored by:ThinkGeek >> >> Welcome to geek heaven. >> >> http://thinkgeek.com/sf >> >> _______________________________________________ >> >> Dynapi-Dev mailing list >> >> [EMAIL PROTECTED] >> >> >> > >> > http://www.mail-archive.com/[EMAIL PROTECTED]/ >> > >> > >> > __________________________________ >> > Do you Yahoo!? >> > Yahoo! SiteBuilder - Free, easy-to-use web site >> design software >> > http://sitebuilder.yahoo.com >> > >> > >> > >> > ------------------------------------------------------- >> > This sf.net email is sponsored by:ThinkGeek >> > Welcome to geek heaven. >> > http://thinkgeek.com/sf >> > _______________________________________________ >> > Dynapi-Dev mailing list >> > [EMAIL PROTECTED] >> > >> > http://www.mail-archive.com/[EMAIL PROTECTED]/ >> >> >> >> >> >> > ------------------------------------------------------- >> This sf.net email is sponsored by:ThinkGeek >> Welcome to geek heaven. >> http://thinkgeek.com/sf >> _______________________________________________ >> Dynapi-Dev mailing list >> [EMAIL PROTECTED] >> > http://www.mail-archive.com/[EMAIL PROTECTED]/ > > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > [EMAIL PROTECTED] > http://www.mail-archive.com/[EMAIL PROTECTED]/ ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/