claudiobosticco haha, me too.
Already tried these APIs in the 13.1d showcase, but nothing to see so far.
Best regards
Blama
Announcement
Collapse
No announcement yet.
X
-
Blama Okay, sorry, I didn't read carefully the code, maybe I'm still a bit shaken by the announcement of upcoming AI news in another thread ;-)
Leave a comment:
-
Hi claudiobosticco,
thanks. That's what I'm doing now (see #1). I was wondering if this was also possible more decoratively without code after seeing that mask-validators also support transform.
And as this transform happens to be possible with RegExp IMHO, this would work if mask-validators also run serverside. The docs are not clear on this (by only mentioning "JavaScript", not "Java"), so I started this thread.
Best regards
Blama
Leave a comment:
-
Originally posted by Blama View PostAnd out of interest, what would be the best and most declarative way to make a value uppercase? I could also imagine doing this with a customUpdateExpression for example.
https://forums.smartclient.com/forum...094#post241094
Leave a comment:
-
Hi Isomorphic,
you could do something like
Validate: ^(.*)$
Replace: \U\1
But only if the mask-validator also runs on the server.
Out of interest: What would the server script look like?
Best regards
Blama
Leave a comment:
-
Other than specific characters known in advance (like in an ID of the form “u” followed by several numbers, canonicalizing the leading “u” to an uppercase “U”), there is no way to use a regexp replace to transform to uppercase.
The most declarative way this could currently be done is to use a regexp validator plus a one-line Server Script to do the uppercasing.
Leave a comment:
-
ValidatorType.MASK also serverside question
Hi Isomorphic,
the docs for ValidatorType.MASK mention:
If validation is successful a transformation can also be specified via the validator.transformTo property. This should be set to a string in the standard format for string replacement via the native JavaScript replace() method.
Code:public class ValidatorSetStringToUppercase { public boolean condition(Object value, Validator validator, String fieldName, Map<Object, Object> record, DataSource ds, DSRequest request, HttpServletRequest httpServletRequest, ValidationContext validationContext) throws Exception { validationContext.setResultingValue(value != null ? value.toString().toUpperCase() : value); return true; } }
It mentions JavaScript, so I'm not sure here. Either way, a clarification in the docs would help here.
And out of interest, what would be the best and most declarative way to make a value uppercase? I could also imagine doing this with a customUpdateExpression for example.
Best regards
BlamaTags: None
Leave a comment: