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
hemantgarghemantgarg 

Can we check map contains key on visualforce page ?

Can we check map contains key on visualforce page ?

S91084S91084

As far as my knowledge you cannot check if the map contains the key or not in visualforce page. Wht you can do is declare a string and when you create new entry to your map, add teh key value to that string variable.

 

on the visualforce page, check if the string contains the key and then display the map value

 

public String keyString {get;set;}

public Map<Id,Integer> mapValue {get;set;}

 

 

{!IF(contains(keyString,<keyValue>),mapValue[<keyValue>], '')}

PrakritiAdventuresPrakritiAdventures

Hi,

 

i have a rewuirement where i have to render a column based on the key of my map.

 

i was trying something like this

"{!IF(columnMap.containsKey('column1'),true,false)}"

 

can you please tell me how i can use your solution above for my scenario.

 

Thanks