[Laszlo-dev] For Review: Change 20080106-bargull-2 Summary: Adding maxlength for multiline-inputtext (DHTML)

André Bargull a.bargull at intensis.de
Sun Jan 6 10:57:16 PST 2008


Change 20080106-bargull-2 by bargull at dell--p4--2-53 on 2008-01-06 17:19:46
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Adding maxlength for multiline-inputtext (DHTML)

New Features:

Bugs Fixed: LPP-4747 - "Edittext maxlength does not work"

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

Documentation:

Release Notes:

Details:
The HTML- object does not support maxlength natively, so we need to 
implement a js-solution for DHTML.
To get the best visual experience, I'm using the "onkeypress"-event, 
this way we can easily interrupt any user-input as soon as the maxlength 
for the inputtext has been reached.
As keyboard-events are handled quite differently across all supported 
browsers, I needed to add a couple of new quirks to LzSprite, but most 
of them should be self-explanatory (also see 
http://www.quirksmode.org/js/keys.html).

Pasting text into an inputtext is special-handled to match Flash's 
behaviour as much as possible:
- for IE/Safari, I'm simply using the "onbeforepaste"-event
- for Firefox/Opera, I need to detect paste manually because these 
browsers do not support "onbeforepaste"
Flash-behaviour: you can only paste that much chars, as you have still 
available in the inputtext.

Changes in LzText and LzInputText fixes two "stale-data" bugs: you 
cannot use LzInputText#text to retrieve the current text-value, because 
this property does not get updated when the user types in any text. 
Instead of that, you must use LzInputText#getText().


Tests:
see bug-description

Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
M WEB-INF/lps/lfc/views/LzInputText.lzs
M WEB-INF/lps/lfc/views/LzText.lzs

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20080106-bargull-2.tar





More information about the Laszlo-dev mailing list