I am having trouble using JQueryUI with salesforce standard elements. Basically, I want to auto suggest the record names to the user, instead of the user clicking on the salesforce search button.
<apex:inputField value="{!MyRecord.ChildRecord__c}" id="inpId" required="true/>
<script>
jq$(document.getElementById('{!$Component.inpId}')).autocomplete( {
minLength: 2,
autoFocus: true,
source: mySource
});
</script>
Therefore, I want to know if anyone attempted to use JQueryUI with standard salesforce input elements. In my case, the JQueryUI events are not firing for salesforce elements.
I figured out the reason why JQeuryUI was not working on SalesForce standard input element. I was trying to use JQueryUI autocomplete on the input element. The action function that was supposed to be invoked was not called because I did not have
That is we must have immediate=true attribute set so that action function is called immediately. If we do not have this attribute set, SalesForce tries to validate all the standard input elements and if the validation fails, action function is never called.
{!$Component.[elementid]}
doesn't always work for me; I'm not sure why. I prefer to use the Attribute Ends With Selector (http://api.jquery.com/attribute-ends-with-selector/).Try something like this:
Controller:
Hope that helps,
Matt