Fórum

AutoCompleteList validation

Robert Meissner, modificado 7 Anos atrás.

AutoCompleteList validation

Junior Member Postagens: 76 Data de Entrada: 26/02/15 Postagens Recentes
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, modificado 7 Anos atrás.

RE: AutoCompleteList validation

Regular Member Postagens: 175 Data de Entrada: 15/10/14 Postagens Recentes
Hi Robert,

Could you explain completely, i will help you robert.

Thanks,
kiran.
Robert Meissner, modificado 7 Anos atrás.

RE: AutoCompleteList validation

Junior Member Postagens: 76 Data de Entrada: 26/02/15 Postagens Recentes
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, modificado 7 Anos atrás.

RE: AutoCompleteList validation

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
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, modificado 7 Anos atrás.

RE: AutoCompleteList validation

Junior Member Postagens: 76 Data de Entrada: 26/02/15 Postagens Recentes
Thanks for your effort, i will check this on occasion.