I have below code where after I do enter an auto complete input text value I need to click elsewhere for the apex class method {!applyfiler} to work. But I need to call that method instantly after input text value enterred without any further click. Can someone please help me here?
Apex page code
<apex:pageblockSectionItem >
<apex:outputText rendered="{!userType == 'Admin' || userType == 'HomeOffice' || userType == 'Field'}">Compliance Incident Transaction Name</apex:outputText>
<apex:inputText styleClass="apexCITautocomplete" value="{!selectedCIT}" id="Rep">
<apex:actionSupport event="onchange" action="{!applyfiler}" rerender="pb"/>
</apex:inputtext>
</apex:pageblockSectionItem>
onKeyPress
event, but why would you want to call a method like this? If there is a query or a DML you will very likely to hit the limits and break everythingonkeypress
oronkeyup
instead ofonchange
event. I think you should use an actionfunction and call it only when user has typed 2 or more characters. OR you can use a pre-built component Autocomplete v2