Scenario: I used the component and infront autcomplete. I used one command link with image for search.
My goal is to display the cursor in autocomplete after clicking on the command link.
My code is as follows:
Autofill
<p:autoComplete id="senderAutocomplete" widgetVar="senderInfo"
value="#{customerReviewLazyDataModel.customerReviewVO.senderVO}"
completeMethod="#{customerReviewLazyDataModel.searchOrganizations}"
var="senderVO"
itemValue="#{senderVO}" converter="organizationConverterForCustomerReview"
size="60">
commandlink
<p:commandLink oncomplete="setFocus()" ajax="true">
<p:graphicImage value="/app-resources/themes/yob/images/search.png" style="margin-bottom: -4px;"></p:graphicImage>
</p:commandLink>
Js function
function setFocus(){
document.getElementById("senderAutocomplete").focus();
}
Is there any solution to this problem?
source
share