You need to sign in to do that
Don't have an account?
Enrico dev
Access apex Map in Javascript
I m trying to access a the apex Map named "resultsMap" with javascript, I would like to get contact last name using contact id.
VF page:
Do you know hoe to accomplish that ?
Thanks in advantage for any advice.
public class AccessMapJS { public Map<ID, Contact> resultsMap{get;set;} public String JsonMap{get;set;} public AccessMapJS(){ resultsMap = new Map<ID, Contact>([SELECT Id, LastName FROM Contact limit 3]); JsonMap=JSON.serialize(resultsMap); } }
VF page:
<apex:page controller="AccessMapJS" > <script> // Access here resultsMap: get contact last name using contact id </script> {!resultsMap} </apex:page>
Do you know hoe to accomplish that ?
Thanks in advantage for any advice.
Try Something Like This {!resultsMap[Contactid].lastname}
See Below link Understand much more about it.
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_dynamic_vf_maps_lists.htm?SearchType=Stem
{!resultsMap[Contactid].lastname} works with Visual force tags, but it seems not working in javascript
Can you post your vf page for further understanding?
Please help me by elaborating it.