Forums de discussion

AutoCompleteList validation

Robert Meissner, modifié il y a 7 années.

AutoCompleteList validation

Junior Member Publications: 76 Date d'inscription: 26/02/15 Publications récentes
Hello,

i have a <aui:input type="text"> with an AutoCompleteList on it. Additionally, i want to have a Validator, that triggers after "select" on the AutoCompleteList ist triggered, and not onBlur of the textfield. Anyone ever solved this?
thumbnail
Kiran Yalavali, modifié il y a 7 années.

RE: AutoCompleteList validation

Regular Member Publications: 175 Date d'inscription: 15/10/14 Publications récentes
Hi Robert,

Could you explain completely, i will help you robert.

Thanks,
kiran.
Robert Meissner, modifié il y a 7 années.

RE: AutoCompleteList validation

Junior Member Publications: 76 Date d'inscription: 26/02/15 Publications récentes
Thanks for your willingness. The problem with my validator is that it triggers on blur, i.e. on select of the AutoCompleteList, but at this time, my textfield contains an invalid value. This means, that i cannot use the standard validator on my textfield but have to use a custom validator, that triggers on select of the AutoCompleteList. But then i have one validator missing, i.e.: what if the user enters a value without using the AutoCompleteList?
thumbnail
Kyle Joseph Stiemann, modifié il y a 7 années.

RE: AutoCompleteList validation

Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Hi Robert,
You could trigger the input's blur event on the AutoCompleteList's select event:

new Y.AutoCompleteList({
/* ... your code here ... */
after: {
select: function(event) {
this.get("inputNode").simulate("blur"); // or you could fire the validation event here
}
}
});


If that doesn't work, you could fire whatever validation event you need to fire on the select event instead of firing the blur event. I'm not an expert on validation, so I'm not sure what that event would be.

- Kyle
Robert Meissner, modifié il y a 7 années.

RE: AutoCompleteList validation

Junior Member Publications: 76 Date d'inscription: 26/02/15 Publications récentes
Thanks for your effort, i will check this on occasion.