Maybe you should encapsulate this 'delay and update' like is done on the swf side (see LzForceScrollAttrs, although this is not so much 'force' as 'wait for layout and then update'). You could probably set your timeout to 0, because I think the point is, that the timeout will not be serviced until your current call has returned and all the layout it caused has happened. Essentially, you are using the timeout to queue a co-routine that will run when the current call is done.
Anyways, I think we should have a general mechanism for queuing any measuring code that has to run when layout changes, and you probably should call that mechanism everywhere where __updatefieldsize is currently called (because I bet those are not working either -- e.g., do you get the right adjustment if you whack the font to something huge? Or, do we need a similar delay there?) On 2009-11-02, at 19:54, Henry Minsky wrote: > Change 20091102-hqm-F by [email protected] on 2009-11-02 19:50:14 EST > in /Users/hqm/openlaszlo/trunk-clean > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: fix for computing maxscroll on DHTML text view > > New Features: > > Bugs Fixed: LPP-8583 > > Technical Reviewer: max > QA Reviewer: ptw > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Details: > > + having setscrollevents=true causes the > LzTextSprite.setScrolling(true) to be called, but > __updatefieldsize needs to be called to get the new scrollHeight and > send it back to the LFC. > But you need to actually wait for some time period to let the browser > re-layout the scrolldiv. > So I used a 200msec timer. This seems like a non-robust solution, but > I am not sure how > to fix it otherwise. > > > Tests: > > testcase.lzx from bug report, and then check that tfield.maxscroll is > greater than 1 > > > Files: > M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js > > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20091102-hqm-F.tar > _______________________________________________ > Laszlo-reviews mailing list > [email protected] > http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
