This looks similar to LPP-4773, so better don't make the same mistake twice!
You left a (n uncommented) Debug.info in there. Perhaps we should extend initstage to handle this case? I.e., have initstage be able to specify which children to init when? I'm always leery of using explicit constants like '3'. On 2011-03-18, at 02:12,max at openlaszlo.org <http://www.openlaszlo.org/mailman/listinfo/laszlo-dev> wrote: >/ Author: max />/ Date: 2011-03-17 23:12:38 -0700 (Thu, 17 Mar 2011) />/ New Revision: 18917 />/ />/ Modified: />/ components/trunk/lib/tab/tab.lzx />/ Log: />/ Change maxcarlson-20110317-Rbc bymaxcarlson at friendly <http://www.openlaszlo.org/mailman/listinfo/laszlo-dev> on 2011-03-17 10:12:51 PDT />/ in /Users/maxcarlson/openlaszlo/trunk2/my-apps/components-clean />/ forhttp://svn.openlaszlo.org/components/trunk />/ />/ Summary: Defer instantiation of tab contents until open() />/ />/ Bugs Fixed: LPP-9826 (partial) />/ />/ Technical Reviewer: promanik />/ QA Reviewer: hminsky />/ />/ Details: Use method from tabslider/tabelement to defer child creation until open(). />/ />/ Tests: test/tab_test.lzx starts up ~3x faster. />/ />/ />/ />/ Modified: components/trunk/lib/tab/tab.lzx />/ =================================================================== />/ --- components/trunk/lib/tab/tab.lzx 2011-03-17 23:50:35 UTC (rev 18916) />/ +++ components/trunk/lib/tab/tab.lzx 2011-03-18 06:12:38 UTC (rev 18917) />/ @@ -90,6 +90,9 @@ />/ if (this.selected === selected) return; />/ this.selected = selected; />/ />/ + // If we still have children to create, do it! />/ + if (this.__remainingChildren) this.__finishCreate(); />/ + />/ // Tell the tabgroup about the change (unless initiated by it) />/ var istabgroup = (this.parent instanceof lz.tabgroup); />/ if (istabgroup&& !parent.updating&& this.selected) { />/ @@ -181,6 +184,33 @@ />/ ]]> />/ </method> />/ />/ +<!--- Override view.createChildren() to create only the first three />/ + children (the layout, tabtitle and tabpanel), deferring the rest />/ + until __finishCreate() is called />/ + @access private --> />/ +<method name="createChildren" args="children"> />/ +<![CDATA[ />/ + var istabgroup = (this.parent instanceof lz.tabgroup); />/ + if (istabgroup&& (! this.selected)) { />/ + super.createChildren(children.splice(0, 3)); />/ + if (children.length) { />/ + this.__remainingChildren = children; />/ + } />/ + } else { />/ + super.createChildren(children); />/ + } />/ + //Debug.info('createChildren', children); />/ + ]]> />/ +</method> />/ +<!--- Finish creating children />/ + @access private --> />/ +<method name="__finishCreate"> />/ +<![CDATA[ />/ + super.createChildren(this.__remainingChildren); />/ + Debug.info('__finishCreate', this.__remainingChildren); />/ + this.__remainingChildren = null; />/ + ]]> />/ +</method> />/ </class> />/ />/ />/ />/ />/ _______________________________________________ />/ Laszlo-checkins mailing list />/ Laszlo-checkins at openlaszlo.org <http://www.openlaszlo.org/mailman/listinfo/laszlo-dev> />/ http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins /
