+ Start a Discussion
Prathap I am :)Prathap I am :) 

Using map display the account id's and names in vf pg through controller

Ashish_SFDCAshish_SFDC
Hi Prathap, 


See the links below which have sample code, 

http://salesforce.stackexchange.com/questions/8667/displaying-a-mapstring-mapstring-object-in-visualforce-page

http://salesforce.stackexchange.com/questions/23213/displaying-map-of-a-map-in-visualforceand-using-inner-key-as-url-path-of-outer


Regards,
Ashish


sunny522sunny522
Hi Prathap,
     Go through the example below.

Apex Class:

public class AccountsDisplay{
    public map<id,account> accountmap {get;set;}
    public AccountsDisplay(){
        accountmap =new map<id,account>([select id,name from account]);
        system.debug('................'+accountmap );
    }
}

visualforce page:
<apex:page controller="AccountsDisplay">
<apex:repeat value="{!accountmap }" var="key">
        <apex:outputText value="{!key}" /> --
        <apex:outputText value="{!accountmap [key].name}" /><br/>
</apex:repeat>
</apex:page>

It will display account id's and names in visualforce page

if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.