You need to sign in to do that
Don't have an account?
soa
Force.com Zillow Mashup using VisualForce
Hi ,
I am trying to invoke a REST web service through Force.com (Visual Force) as mentioned in the example provided in :
http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup
The code for the page editor is as follows:
Code:
<apex:page standardController="Lead" extensions="ZillowLeadExtension"> <apex:form > <!-- Insert new Lead --> <apex:pageBlock title="New Lead" > <apex:pageBlockButtons location="top"> <apex:commandButton action="{!save}" value="Save" id="saveLead" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Lead Data" columns="1"> <apex:inputField value="{!aLead.LastName}" /> <apex:inputField value="{!aLead.FirstName}" /> <apex:inputField value="{!aLead.Company}" /> <apex:inputField value="{!aLead.Phone}" /> <apex:inputField value="{!aLead.Email}" /> <apex:inputField value="{!aLead.Street}" /> <apex:inputField value="{!aLead.City}" /> <apex:inputField value="{!aLead.State}" /> <apex:inputField value="{!aLead.PostalCode}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
the code for the class ZillowLeadExtension is :
Code:
public class ZillowLeadExtension { public Lead aLead ; public ZillowLeadExtension(ApexPages.StandardController controller) { aLead = new Lead() ; } public PageReference save() { PageReference pr ; try{ ZillowService p = new ZillowService() ; // make the web service call out ZillowTypes.PropertySearchResponse r = p.searchZillow( aLead.Street, aLead.City, aLead.State) ; // store in custom field aLead.Home_Value__c = r.getZEstimateAmount() ; // insert new record into DB insert aLead ; // redirect to the newly inserted lead pr = new PageReference( '/' + aLead.id ); } catch( ZillowTypes.ZillowException e){ System.debug( '**** Caught Exception' +e ) ; } return pr ; } }
I have included all the other classes on which ZillowLeadExtension depends.When I try to save the Code written in the page editor , I am getting the following error:
Error: Unknown property 'LeadStandardController.aLead' |
Why is it not taking the ZillowLeadExtension class?
is there any other way to include the class??
Please Help..
Regards,
Diti
<SCRIPT type=text/javascript>//
var tabId = getCookie('dmTab');
var closeButtonId = 'thePage:theForm:closeButton';
if (tabId && getBottomPanelHeight() > 28) {
showCloseButton(closeButtonId, true);
} else {
showCloseButton(closeButtonId, false);
}
document.getElementById('thePage:theForm:showControllerLink').style.display = (false) ? 'inline' : 'none';
//
</SCRIPT>
This may help you:
Your aLead is a public field not a property define it this way:
The reason is you are using aLead as a Controller property on your visualforce page.
I have a button for GetZestimate that calls a VF page "Update Lead"
The related ZillowLeadUpdate page is a mess. From the tutorial, the VF page called "aLead" for all the input fields. I've made every change that I could in the ZillowLeadUpdate extension...I'm back to essentially the version that I started with:
Thank you.