You need to sign in to do that
Don't have an account?
sonali verma
action support not working
Hi
I wan to display all contacts associated with account name once the account is seledted through a lookup in a selarate pagebblock table
in same vf page.
Thanks
sonali
I wan to display all contacts associated with account name once the account is seledted through a lookup in a selarate pagebblock table
in same vf page.
public class SelectAccountThroughLookup { //I need to select account name from contact lookup. so I need variable of type contact private Contact con; public boolean check{get;set;} public SelectAccountThroughLookup(ApexPages.StandardController stdcontroller) { this.con=(Contact)stdcontroller.getRecord(); } public SelectAccountThroughLookup() { //check=false; } public List<Contact> getShowContactName() { List<Contact> conList=[select LastName from Contact where Name=:con.AccountID]; return conList; } } <apex:page standardController="contact" extensions="SelectAccountThroughLookup"> <apex:form > <apex:pageBlock title="Select Account Name from Lookup"> <apex:outputLabel >Select Account Name</apex:outputLabel> <apex:inputField id="field1" value="{!Contact.AccountID}"> <apex:actionSupport event="onchange" id="id1" reRender="check"/> </apex:inputField> </apex:pageBlock> <apex:outputPanel id="check"> <apex:pageBlock title="Contact Details"> <apex:pageBlockTable value="{!showContactName}" var="c"> <apex:outputText value="{!c.LastName}"></apex:outputText> </apex:pageBlockTable> </apex:pageBlock> </apex:outputPanel> </apex:form> </apex:page>But action support is not working . pls guide me.
Thanks
sonali
every thing is fine in your code, here the problem is in your contact query, you are trying to query list of contacts having name as its account id, change the query as
and use
Instead of using
Please change your code as below, it will work.
Please let me know, if it works for you.
Best Regards,
Dayakar.D
All Answers
every thing is fine in your code, here the problem is in your contact query, you are trying to query list of contacts having name as its account id, change the query as
and use
Instead of using
Please change your code as below, it will work.
Please let me know, if it works for you.
Best Regards,
Dayakar.D
Thanks, I got the concept. Its working.
Regards
sonali