Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Fix Version/s: 1.8.1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
-
Workaround Exists:Yes
-
Workaround Description:
Description
The inputText component has a maxlength attribute which will limit the characters in the component. There has been a request for this feature to be added onto the inputTextarea component.
Issue Links
Activity
Field | Original Value | New Value |
---|---|---|
Priority | Major [ 3 ] | Minor [ 4 ] |
Support Customer Ref. #s | https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=5139 |
Workaround Description |
Use Javascript to replicate similar behavior JavaScript: <script language="javascript"> function textCounter(field,maxlimit) { if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit); } </script> Component: <ice:inputTextarea id="text" cols="50" rows="3" value="#{testBean.text}" onkeydown="textCounter(this, 20)"/> |
|
Workaround Exists | [Yes] |
Salesforce Case | [50070000008Jidz] |
Fix Version/s | 1.8.1 [ 10170 ] |
Assignee Priority | P1 | |
Assignee | Mark Collette [ mark.collette ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #18853 | Thu May 07 17:22:20 MDT 2009 | mark.collette | |
Files Changed | ||||
![]() ![]() ![]() ![]() ![]() |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19883 | Tue Dec 08 12:35:50 MST 2009 | judy.guglielmin | |
Files Changed | ||||
![]() ![]() ![]() ![]() ![]() ![]() |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19884 | Tue Dec 08 12:36:20 MST 2009 | judy.guglielmin | |
Files Changed | ||||
![]() |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 |
To add some background info, maxlenth is not a standard attribute of textarea, in the html specification. None of the browsers support it. For javascript solutions, there are two main ones: the complicated and more correct solution of capturing the key presses to discard the most recently pressed key, and the simple one that involves truncating the text. The complicated one can fail at handling pasted values, and is tricky to handle non-input key events. The simple one handles those issues fine, but doesn't exactly properly handle things when the caret is not at the end of the textarea. As well, the text that will be truncated does briefly appear before being discarded.
With all these caveats in mind, we'll go with the simple solution, which is also suggested by the issue originator.