VF page:
<apex:page standardcontroller="opportunity" >
<c:vendortab componentValue="{!Opportunity.AccountId}"/>
</apex:page>
VF Component:
<apex:component controller="componenttester" access="global">
<apex:attribute name="componentValue" description="testing" type="Id" required="required" assignTo="{!acct}"/>
<apex:form >
<apex:tabPanel id="theTabPanel" >
<apex:tab label="Contactdetails" name="Contactdetails" id="Contactdetails">
<apex:pageBlock title="Account Detail">
<apex:pageBlockSection title="Contacts" columns="1">
<apex:pageBlockTable value="{!conts}" var="cont" rows="10">
<apex:column value="{!cont.Id}"/>
<apex:column value="{!cont.Name}"/>
<apex:column value="{!cont.Email}"/>
<apex:column value="{!cont.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:tab>
</apex:tabPanel>
</apex:form>
</apex:component>
apex class:
public class componenttester
{
public List<Contact> conts {get; set;}
public Id acct {get; set;}
public componenttester(){
}
public void componenttest()
{
system.debug(acct);
conts=[select id, Name, Email, Phone from Contact where AccountId=:acct];
system.debug(conts);
}
}
I have added the vf page as section in the opportunity layout. i am passing the accountid from opportunity and query the contact corresponding to the account and displaying the list of contact in the standard opportunity layout as inline vf section.but i am not get any contact values.kindly help me to solve this.