[ 
https://issues.apache.org/jira/browse/WICKET-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536192
 ] 

Will Hoover commented on WICKET-1085:
-------------------------------------

1) As Billie stated- that was the intention to have "(999)999" evaluate as a 
string. Most masks should be evaluated a string seeing that most of the time a 
mask would contain special characters that define the mask (i.e. "(", ")", and 
"-" in the example). For special cases where a string needs to be converted 
(such as the case with a date) it would be just as easy to use a converter that 
converts a date based upon a regexp check on the server. If I am missing 
something let me know :o)

2) To clarify, this is only an issue when a "invalid" prefilled value is 
provided. In which case, IMHO, is an issue with the data provided. If the user 
does not have a valid value to begin with then it's an issue with their data. 
However, the script does handle "valid" prefilled values. The script assumes 
that the initial value (if any) originated from a valid source (i.e. DB or 
other source).

If this is really an issue that needs to be addressed...

A) I could add a page load listener that would validate the value and handle 
conversion accordingly, but what would we do if an invalid value is found? 
notify the user and leave it as is (really doesn't resolve the issue)? clear 
the value (may confusing to developers to see their data missing)? 

B) We could do the validation on the server side before rendering the page- 
seeing that we already have the mask pattern at that point. Not to mention, we 
need to do the conversion (and possibly validation) going back to the server 
anyways, but this will duplicate our efforts in that the code used to 
evaluate/convert the value would exist on the server as well as the client.

> Input Text Mask
> ---------------
>
>                 Key: WICKET-1085
>                 URL: https://issues.apache.org/jira/browse/WICKET-1085
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Will Hoover
>            Assignee: Frank Bille Jensen
>            Priority: Trivial
>         Attachments: inputTextMask.js
>
>
> Allow developers to designate a keystroke input pattern for the input text 
> component. The pattern  would be used on the client to control valid 
> keystrokes for the current cursor position within the input text field in 
> relation to the specified pattern.
> For example, a pattern could be designated as "(999)-9999" causing only 
> number values in each position where a "9" appears and using the "(", ")", 
> and "-" as masking characters. When the cursor position reached one of these 
> mask characters the cursor position would advance to the next "9" position. 
> The resulting mask would appear as "(___)___-____" within the input text 
> value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to