<apex:outputPanel rendered="{!map.size > 0}" > 

this doesn't work. gives the error:

Unknown property 'map.size'

  • 2
    There's no documented way to do this. You will want to use a List instead.
    – sfdcfox
    Jan 16, 2018 at 21:27

1 Answer 1


Like @sfdcfox says in the comments, there's no official way to do this. If your data type was a list, the size field is exposed to visualforce, but not for sets or maps.

You can get around this restriction by adding a variable to your controller to provide the size of your map on a get.

public Integer SizeOfMap { get { return SomeMap.size(); } } 

<apex:outputPanel rendered="{!SizeOfMap > 0}" > 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .