OK  after hacking around some more,  it appears that just switching to calling 
updateHeight instead of $lzc$set_height, in response to the text kernel
change events, is sufficient to fix the text autosizing behavior, without 
breaking anything else. 


So the only change besides that is that updateHeight now updates the memoized 
height as well. 

This also fixes a bug in DHTML where an autosizing inputtext view  did not 
update it's height when the kernel reported 
a new  text content height (via scrollHeight).


Change 20100318-hqm-F by [email protected] on 2010-03-18 11:12:32 EDT
    in /Users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary:  fix for automatic height sizing of multiline text fields

New Features:

Bugs Fixed: LPP-8591 

Technical Reviewer: ptw
QA Reviewer: max
Doc Reviewer: (pending)

Documentation:

Release Notes:

Overview:
    
When a multiline text field which is resizable (hassetheight == false)
gets a content-changed event, this updates the height without
bashing the 'hassetheight' flag.


Details:

LaszloView.lzs:  updateHeight now updates the memoized height value

LzText, LzInputText: call updateHeight instead of the $lzc$set_height setter 
when 
view is autosizing itself.

LzText#scrollevent: In DHTML, typing a newline into a resizable input
text field did not properly increase the textfield height to enclose
the text.  

When text is added, the kernel does call back to the LFC to update the
"scrollHeight", so I added a call to updateHeight() in the LFC code that
handles scrollHeight events from the kernel.

Tests:

smokecheck 
lzpix demo
test/lfc/maxscroll.lzx 

test case below, the bounding box should expand vertically to just enclose the 
text as you
type. 

<canvas>
        <inputtext width="100"  
                   bgcolor="#cccccc"  
                   scrollevents="true"
                   multiline="true">Hey there! This text should wrap onto a few 
lines.
        </inputtext>
</canvas>



Files:
M       WEB-INF/lps/lfc/views/LzInputText.lzs
M       WEB-INF/lps/lfc/views/LzText.lzs


Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100318-hqm-F.tar

Reply via email to