Example 1:
<apex:page standardController="Contact">
<apex:inputField value="{!contact.account}"/>
</apex:page>
<apex:inputField value="{!contact.account}"/>
</apex:page>
Example 2:
Apex Class:
public class con {
public contact c { get; set; }
public con() {
c = new contact();
}
public void search() {
// c.accountid has the selected ID.
}
}
public contact c { get; set; }
public con() {
c = new contact();
}
public void search() {
// c.accountid has the selected ID.
}
}
VisualForce Page:
<apex:page controller="con">
<apex:form>
<apex:pageblock>
<apex:pageblocksection>
<apex:inputfield value"{!c.accountid}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
<apex:form>
<apex:pageblock>
<apex:pageblocksection>
<apex:inputfield value"{!c.accountid}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
No comments:
Post a Comment