You need to sign in to do that
Don't have an account?
Naresh.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
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
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
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