Re: [Xsltforms-support] Two defects in xforms.close method
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2011-04-18 19:44:54
|
Ivan, I have added the Calendar.INSTANCE cleaning and I have integrated your suggestion about the hasXFElement directly into xforms.dispose() into Rev 500. Thank you for your feedbacks! -Alain Le 18/04/2011 12:15, Ivan Ponomarev a écrit : > Dear Alain, > > as soon as our date picker bugfix proved to be useful, maybe you will > find some time to include another piece of our code in /trunk, so we > will not have to continue merging our patches into your code? Thanks a > lot in advance! > > As I wrote once, we are dependent on xforms.close() method, because we > are showing and hiding XForms dynamically using AJAX without page > reload, and the problem is that standard version of xforms.close() > actually doesn't clean up everything! > > This causes two problems I reported earlier, this one: > > http://sourceforge.net/mailarchive/forum.php?thread_name=4D332B30.8070300%40mail.ru&forum_name=xsltforms-support > > and the first of the two given here (thanks God, we're completely > finished with the second one): > http://sourceforge.net/mailarchive/forum.php?thread_name=4D3A0CE5.4020709%40mail.ru&forum_name=xsltforms-support > > We solved both of them, here is a solution: > > in xforms.close method, after xforms.dispose(... (1627) the following > code should be inserted: > > Calendar.INSTANCE = null; /*so the next time this object will be > recreated and all event handlers will be bound properly*/ > dropHasXFElement(document.documentElement); > > where > > /*Just full recursion over the whole DOM to remove hasXFElement > attributes that will spoil everything the next time!!*/ > function dropHasXFElement(element){ > element.hasXFElement = null; > var subelement = element.firstChild; > while(subelement){ > if (subelement.nodeType == NodeType.ELEMENT) > dropHasXFElement(subelement); > subelement = subelement.nextSibling; > } > } > > > Regards, > > Ivan Ponomarev. > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |