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
Naresh.soft12Naresh.soft12 

need clarification on maps

public class Countrydisplay{
public map<String,Map<String,String>> stringStringMap{set;get;}
public Countrydisplay(){
}
public map<String,map<String,String>> getDisplay(){
stringStringMap=new map<String,Map<String,String>>{'india' => new Map<String, String>{'a'=>'b', 'c'=> 'd'}, 'usa' =>new Map<String, String> {'e'=>'f', 'g'=> 'h'} };
System.debug(' ----------------------------------------------------------------  >>>>>>>>>>>>>>>' + stringStringMap.get(outerKey).get(innerKey));
}
}
}

i want to display this map in vf page in pick list filelds and please send me sample vf page
VineetKumarVineetKumar
To display a map on page.
Take all the key in your a list and iterate over the list of keys and passing the values to the map
Code would look something like this
<apex:repeat value="{!stringStringMap}" var="outerKey">
    <apex:repeat value="{!stringStringMap[outerKey]}" var="innerKey">
        <apex:repeat value="{!stringStringMap[outerKey][innerKey]}" var="dataVariable">
            <apex:outputLink value="{!innerKey}">
                {!outerKey}
            </apex:outputLink>
        </apex:repeat>
    </apex:repeat>
</apex:repeat>


 
GauravGargGauravGarg
Hi Naresh,

Please use below code to display values on VF page:
public class Countrydisplay{
public Countrydisplay(){
}
public List<SelectOption> getDisplay() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('','--None--'));
        options.add(new SelectOption('a','b'));
        options.add(new SelectOption('c','d'));
        
        return options;
    }

Let me know if you need any help on this.

Thanks,
Gaurav
Naresh.soft12Naresh.soft12
thanks Gaurav