function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prathap I am :)Prathap I am :) 

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

Hi Prathap, 

See the links below which have sample code,


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/>

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.