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

this doesn't work. gives the error:

Unknown property 'map.size'

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

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}" > 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.