Hi Team,
I have multifield, under that i gave textfield.
user can enter value multiple times in textfield, that time how i can check uniqueness in value.
Example:
Multifield
1. textfield -- example.
2. textfield - example1
3. textfield - example(if user enters the same value, i need to show error message as enter different value).
Please provide some material or suggestions, it would be great help for me.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
If you see the documentation for textfield [1], you will find 1 helpful listener waiting for you there:
blur: Fires when this field loses input focus
Apart from this you can also implement beforesubmit ( fires when you submit the dialog, add you logic for checking randomness and return true or false accordingly, that it ) listener available for dialog
[1] http://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.Ext.form.TextField
Thanks
Views
Replies
Total Likes
Hi,
If you see the documentation for textfield [1], you will find 1 helpful listener waiting for you there:
blur: Fires when this field loses input focus
Apart from this you can also implement beforesubmit ( fires when you submit the dialog, add you logic for checking randomness and return true or false accordingly, that it ) listener available for dialog
[1] http://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.Ext.form.TextField
Thanks
Views
Replies
Total Likes
you have to write a listener and check the value of each field. refer [1] to know about listeners
[1] https://docs.adobe.com/docs/en/aem/6-0/develop/components/widgets.html
Views
Replies
Total Likes
You can code a custom xtype that uses a multifield. THen you can - in the JS file - read the values that the author enters into the textfield and process it to meet your business requirements.
For example -- see how we handle textfield (type CQ.Ext.form.TextField) - in the JS file in this article:
Creating Adobe Experience Manager Components that use Standard Tag Libraries
Notice how we can use events to modify values (This is how you can control text values used in a component's dialog ). For example:
// overriding CQ.form.CompositeField#getRawValue
getRawValue: function() {
if (!this.devWeapon){
return null;
}
var title = this.nameField.getValue();
var image = this.devImage.getValue();
var link = this.codeName.getValue();
var target = this.devWeapon.getValue();
var altText = this.devDesc.getValue();
if (title == '')
title = " ";
if (link == '')
link = " ";
if (target == '')
target = " ";
if (altText == '')
altText = " ";
var value = title + "|" + image + "|" + link + "|" + target + "|" + altText;
this.hiddenField.setValue(value);
return value;
},
Views
Replies
Total Likes