Unable to do case-insensitive Asynchronous Validation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015 03:48 AM
Hi,
I have made Asynchronous validation in few of my fields as shown below,
But the above code reports an error
For example, if I type
Is it possible to do the validation without considering the case.
Thanks in Advance,
I have made Asynchronous validation in few of my fields as shown below,
{ name : "alfresco/forms/controls/TextBox", config : { fieldId : "PRODUCT_NAME", label : "Product Name", name : "prop_cm_name", description : "Provide a Unique Value for the Product Name.", requirementConfig : { initialValue : true }, validationConfig : [ { validation : "validateUnique", //This doesn't do case-insensitive validation itemsProperty : "response.productNameList", errorMessage : "The Product Name already exists!", publishTopic : "ALF_CRUD_GET_ALL", publishPayload : { url : "retrieve-library-list?retrieve=Product%20Library" } } ] }}
But the above code reports an error
"The Product Name already exists"
only when I type the exact case as it is returned by the Json Array, sample JSON Response shown below,{ "productNameList": [ { "prop_cm_name": "Banner Small" }, { "prop_cm_name": "Business Vertical" }, { "prop_cm_name": "Banner Medium" }, { "prop_cm_name": "Business Accessories" }, { "prop_cm_name": "Banner Large" } ]}
For example, if I type
"Banner Small"
, I'll get the error, but if I type "banner small"
, I won't get the error.Is it possible to do the validation without considering the case.
Thanks in Advance,
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015 11:11 PM
Hi,
Can someone help me to do this case-insensitive validation?
Thanks in Advance.
Can someone help me to do this case-insensitive validation?
Thanks in Advance.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2015 01:23 PM
Can I get any help or suggestions on this please?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2015 04:09 AM
There are a couple of options here…
1) You can extend alfresco/forms/controls/TextBox and provide your own validation function that is case-insensitive (using the "validateUnique" function as a starting point)
2) You can raise an issue on the Aikau GitHub project and hope that it gets addressed at some point in the future
3) You could implement a solution and raise this as a pull request
The solution would need to be that the "validateUnique" validator accepts an additional configuration attribute of "caseSensitive" which defaults to true (for backwards compatibility) and you could then configure that.
Regards,
Dave
1) You can extend alfresco/forms/controls/TextBox and provide your own validation function that is case-insensitive (using the "validateUnique" function as a starting point)
2) You can raise an issue on the Aikau GitHub project and hope that it gets addressed at some point in the future
3) You could implement a solution and raise this as a pull request
The solution would need to be that the "validateUnique" validator accepts an additional configuration attribute of "caseSensitive" which defaults to true (for backwards compatibility) and you could then configure that.
Regards,
Dave
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2015 02:04 PM
Thanks Dave, for your response. That gives me some idea. I'll try to implement any of your suggestions.
