FROM : Mark Dawson
DATE : Fri Dec 10 19:48:28 2004
When writing a custom formatter, how do I do a "final" string
validation? I've overriden "isPartialStringValid", which works fine,
up to a point.
In my case, I allow fractions. So the user typing in "1/" is valid to
that point. However, if they try to commit that (pressing the enter
key, tabbing, exiting out, etc) the string is now INVALID (i.e., you
need a denominator).
I assume there should be some test in getObjectValue for "exit key",
returning an error (not allowing the user to exit) if the final keys
are not valid, and a similar test in stringForObjectValue that would
not cause a reformat until the text field was committed & validated
(i.e., I might allow fractional input, but want only decimal output,
1/2 --> 0.5).
Thanks for any insight!
mark
<email_removed>
DATE : Fri Dec 10 19:48:28 2004
When writing a custom formatter, how do I do a "final" string
validation? I've overriden "isPartialStringValid", which works fine,
up to a point.
In my case, I allow fractions. So the user typing in "1/" is valid to
that point. However, if they try to commit that (pressing the enter
key, tabbing, exiting out, etc) the string is now INVALID (i.e., you
need a denominator).
I assume there should be some test in getObjectValue for "exit key",
returning an error (not allowing the user to exit) if the final keys
are not valid, and a similar test in stringForObjectValue that would
not cause a reformat until the text field was committed & validated
(i.e., I might allow fractional input, but want only decimal output,
1/2 --> 0.5).
Thanks for any insight!
mark
<email_removed>
| Related mails | Author | Date |
|---|---|---|
| Mark Dawson | Dec 10, 19:48 | |
| Louis C. Sacha | Dec 12, 10:51 |






Cocoa mail archive

