Posts

Showing posts from April, 2009

Autocomplete component

Image
Hello everyone, just wanted to share with the community this custom component I made and give something back for the help I've received :) The purpose of the component is to enable autocomplete in lookup fields. I used the autocomplete js created by Jim Roos: (http://www.jimroos.com/2007/05/ajax-autocomplete.html) but made some modifications to it so that it could interact with an Apex controller among some other things... So my idea was that if you were making a VF page that had an inputfield that was related to a lookupfield you would just insert this autocomplete component to that inputfield. Something like this: <apex:inputField value="{!Contact.accountid}" id="accname" styleClass="cField"> <c:autocomplete ObjectName="Accounts" InputId="{!$Component.accname}" AutoCompleteId="accACid" ClassName="autocomplete300"/> </apex:inputField> The component has 4 parameters: The na