History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4747
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P0 P0
Assignee: André Bargull
Reporter: Anand Nalya
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Edittext maxlength does not work

Created: 18/Sep/07 04:09 AM   Updated: 09/Jan/08 02:03 PM
Component/s: Components - LZ
Affects Version/s: 4.0.3
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 7,793
Fixed in branch: trunk
Runtime: DHTML
Fix in hand: False


 Description  « Hide
The maxlength property for edittext does not work when multiline is set to true.

For example
<edittext maxlength="10"/> allows a maximum of 10 characters as desired but <edittext maxlength="10" multiline="true"/> does not limit character count to 10

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Anand Nalya - 18/Sep/07 04:11 AM
The issue title is wrong here, it should be 'Edittext maxlength does not work'

Amy Muntz - 24/Oct/07 09:53 AM
Andre - could you please take a look at this and fix? Thanks!

André Bargull - 24/Oct/07 12:00 PM
I could reproduce this bug under FF2-DHTML, SWF is not affected.

André Bargull - 09/Jan/08 02:03 PM
------------------------------------------------------------------------
r7793 | bargull | 2008-01-09 23:02:01 +0100 (Wed, 09 Jan 2008) | 35 lines
Ge?\195?\164nderte Pfade:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
   M /openlaszlo/trunk/WEB-INF/lps/lfc/views/LzInputText.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/views/LzText.lzs

Change 20080106-bargull-2 by bargull@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-<textarea> 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 maxlengt
h 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 t
his property does not get updated when the user types in any text. Instead of that, you must use LzInputText#getText().


Tests:
see bug-description


------------------------------------------------------------------------