3

I want to include lookup Icon on my VF page. I tried doing custom lookup page but it is very time consuming and tedious job. So, I decided to use Contact;s AccountID field using inputField. I get total field with inputbox and lookup icon. I dont want input box. I just want lookup Icon to get Account ID and I want to select picklist value accordingly. Please help me to figure out this. Thanks in advance.

2

You can remove the input field from the page by using CSS that is qualified by the element name (i.e. hide the input.hideField but not the a.hideField as the styleClass is applied to both the field and the lookup icon):

<apex:page standardController="Contact">

<style>
input.hideField {
    display: none;
}
</style>

    <apex:form>
        <apex:inputField value="{!Contact.AccountId}" styleClass="hideField"/>
    </apex:form>

</apex:page>

The input field remains in the DOM and is populated by the selection from the popup.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.