function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RajManiaRajMania 

any alternate tag for lookup?

Hi,

   Is any input type avaliable for look-up field, just like for textbox, <apex:inputText> is available, so for lookup fields id any other tag availalbe other than <apex:inputField>

 

Thanks,

Raj

LaurentDelcLaurentDelc

Hi,

 

We use apex:selectList to display the possible values in a picklist (way better UI than the lookup) and populate them from the controller:

 

<apex:pageBlockSectionItem > <apex:outputText value="{!$ObjectType.Contact.fields.Type__c.label}"/> <apex:selectList value="{!yourfield}" size="1"> <apex:selectOptions value="{!methodInController}" /> </apex:selectList></apex:pageBlockSectionItem>

 In this case you will use a methid like this to populate the possible value:

 

public List<SelectOption> getTypeValues(){ List<SelectOption> listTypes = new List<SelectOption>(); for(...){ listTypes.add(new Selectoption(value, label)); } return listTypes; }

 

 Hope it helps.

 

Laurent