1

Action support is refreshing overall page.Only following section should be refreshed.Not happening may be m missing small point.

Vf page:

<apex:pageblockSection title="Prepared For" columns="2"  id="con" >   
 <apex:inputField value="{!quote1.Contactid}">
 <apex:actionsupport event="onchange" action="{!fetchdetails1}" rerender="Con"/>
 </apex:inputField>  
 <apex:inputField value="{!quote1.Phone}"/>                 
 <apex:inputField value="{!quote1.Email}"/>
 <apex:inputField value="{!quote1.Fax}"/>    
</apex:pageblockSection>

Class:

public void fetchdetails1(){
if(quote1.contactId !=null ){con=[SELECT AccountId,CurrencyIsoCode,email,Fax,Id,MailingAddress,MailingCity,MailingCountry,MailingLatitude,MailingLongitude,MailingPostalCode,MailingState,MailingStreet,MasterRecordId,MobilePhone,MOM__c,Name,OwnerId,Phone,Salutation,Title FROM Contact where id=:quote1.contactId limit 1];
  quote1.Phone=con.Phone;
  quote1.Email=con.Email;
  quote1.Fax=con.Fax;
 }}

1 Answer 1

0

rerender is case sensitive....and you are missing a space

in addition, to trigger the on change the input element has to loose focus

try

<apex:actionsupport event="onchange" action="{!fetchdetails1}" rerender="con"/>
2
  • I have space but still it is not working. I have edited as above.
    – Salesforce
    Oct 4, 2015 at 9:40
  • Did you change Con to con?
    – Eric
    Oct 4, 2015 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .