Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: EE-3.3.0.GA_P02, 4.0
-
Fix Version/s: EE-3.3.0.GA_P03, 4.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ICEfaces 4, ace:textEntry, ace:textAreaEntry
-
Assignee Priority:P1
-
Support Case References:Support Case 13217 :- https://icesoft.my.salesforce.com/5007000000wMBld
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
Description
Add a new "charCount" client event to the ace:textEntryArea the ace:textEntry components. This client event will be fired whenever the number of characters entered in the component changes, either by the user typing a new character, deleting one or more characters, or cutting/pasting characters into the component.
The "charCount" client event will provide the following attributes for each event fired:
- currLength: The current length of the value string.
- charsRemaining: The number of characters remaining that can be entered. This is determined via subtracting the currLength value from the maxlength attribute value on the component. If no maxlength attribute value exists, this value is -1 (?).
This new client event supports the use-case where an application would like to present the user with a message indicating how many characters are remaining in a textEntry component that has a maxlength specified.
Note that by using a client event for this information, it is feasible for the application to trap the event on the client and prevent it from submitting to the server, if a purely client-side JavaScript update of the message is desired. In addition, the client event could instead (or in addition) submit to the server if a server-based implementation is desirable. Thus, the client-event approach provides the most flexibility.
The "charCount" client event will provide the following attributes for each event fired:
- currLength: The current length of the value string.
- charsRemaining: The number of characters remaining that can be entered. This is determined via subtracting the currLength value from the maxlength attribute value on the component. If no maxlength attribute value exists, this value is -1 (?).
This new client event supports the use-case where an application would like to present the user with a message indicating how many characters are remaining in a textEntry component that has a maxlength specified.
Note that by using a client event for this information, it is feasible for the application to trap the event on the client and prevent it from submitting to the server, if a purely client-side JavaScript update of the message is desired. In addition, the client event could instead (or in addition) submit to the server if a server-based implementation is desirable. Thus, the client-event approach provides the most flexibility.
Implemented "charCount" client behaviour for ace:textEntry and ace:textAreaEntry. The behaviour can be enabled like so: