is it possible to check for a specific key in a map i.e., whether it exists or not in VISUALFORCE page?
Based on this i need to render a pageblocktable.
No, there's no way to tell if a key exists or not. We don't have access to "containsKey", and any attempt to reference a key that doesn't exist will cause your code to crash and burn catastrophically.
This is related to bug W-1065879 (according to an old forum post). The solution is to check the key in Apex Code, and prevent the rendering of the element or component before the attempted access. Here's an example used in live code:
By iterating over {!wrapperlist}, we can create a pseudo-wrapper that will prevent non-existent keys from appearing. EDITI just realized that this code takes some explaining. You can select from a list of quotes. The map may not always be populated with boolean values, so this wrapper class protects the Visualforce map controller from croaking. | ||||
|
You should really keep this type of logic out of a Visualforce page. A Visualforce page should be used simply for View logic. Instead, add it as part of your controller: Apex
Visualforce
| |||
|
You can build a delimited string with all the keys of the map in controller and then you use SF formula
in a rendered condition display map values with the key. | ||||
|