RE: aui:input - lost focus

thumbnail
Gennaro Lippiello, modified 3 Years ago. Junior Member Posts: 39 Join Date: 3/9/22 Recent Posts

Hello everyone, I'm developing a custom mvc portlet. I have a view.jsp with inside a <aui:input> field.

I want that when the input field losts focus then a method in my class.java starts, check the value of the field and does some operations.

Is this possible?

thumbnail
Gennaro Lippiello, modified 3 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts

Hi ,

You may need to trigger a javascript "focusout" event for that input field and then send a request to server throught Ajax and perform your operation in serveResource() method.

You can refer below it may be helpful:

https://www.javasavvy.com/liferay-jquery-ajax-examples/
https://proliferay.com/alloy-ajax-liferay-portlet/

thumbnail
Gennaro Lippiello, modified 3 Years ago. Junior Member Posts: 39 Join Date: 3/9/22 Recent Posts

Thanks, that worked!