You need to sign in to do that
Don't have an account?
Problem displaying list of items returned from WebService Callout
Good afternoon,
I am having trouble displaying a list of items returned from a webservice callout.
On the visual force page I receive the following error:
Error: Unknown property 'WebServ.CampaignType.name' |
Visual force page:
<apex:repeat value="{!CFCampaigns}" var="campaignList"> {!campaignList.name}
</apex:repeat>
Here's my controller code:
Public List<WebServ.CampaignType> CFCampaigns;
public CF_ctlr() { WebServ.BroadcastServiceHttpPort webService = new WebServ.BroadcastServiceHttpPort(); WebServ.ArrayOfCampaignType result = webService.getFullCampaignList('2134ds'); this.CFCampaigns = result.CampaignType; } public List<WebServ.CampaignType> getCFCampaigns() { return this.CFCampaigns; } public String getCampaignId() { return this.CFCampaigns[0].name;
}
I verified that the property does exist and the getCampaignId method in my controller works.
Any ideas?
Thanks,
Michael
That smacks that there isn't a getName method on the WebServ.CampaignType object.
In your getCampaignId, you use : return this.CFCampaigns[0].name, which is directly accessing the field.
However, when the VF page is rendering the contents of your repeat tag, {!campaignList.name}
equates to campaignList.getName()
The WebServ object/class is generated by WSDL2Apex.
Thanks ,
Michael