I have this autoComplete method in my Primefaces view:
<p:autoComplete id="productId" class="tg"
completeMethod="#{productController.completeProductName}" converter="productConverter"
forceSelection="true" value="#{myController.selected.productId}"
scrollHeight="200" queryDelay="1000" var="product" itemValue="#{product}" itemLabel="#{product.name}"
inputStyleClass="biggerText boldText">
<f:validator validatorId="onSubmitValidator"/>
<f:attribute name="onSubmitRequired" value="true"/>
<f:attribute name="onSubmitRequiredMessage" value="#{bundle.CreateProductRequiredMessage_productId}"/>
<p:ajax event="itemSelect" listener="#{myController.changeProduct()}" resetValues="true" update="@form"/>
</p:autoComplete>
I want to accomplish this: if the user presses the arrow down key, he gets the complete product list. Sadly the completeMethod isn't fired if I press this button and I don't know if I can do this via p:ajax event somehow...
Is this possible, if yes, how?
EDIT.:
Jasper de Vries suggested to use Client Side API. This is my first try with that:
<script type="text/javascript">
jQuery("##{formType}EditForm\\:productId_input").keyup(function(e) {
if(e.which == 40 || e.keyCode == 40)
{
PF('yourAutoCompleteWidget').search('complete-list-dropdown');
}
});
</script>