[SalesForce] Error: Unknown function wrapperList.size. Check spelling

I have a list of a wrapper class which i am using to display values in a pageblockTable.

I want to render this pageblock only when there are records.

I tried using the rendered tag on the pageblock

<apex:pageBlock id="pbmInput" rendered="{!if(wrapperList.size() > 0,true,false)}">

This doesnt allow me to save the VF page

i get the error

Error: Unknown function wrapperList.size. Check spelling

I could have in my controller check the size and accordingly store true or false on a boolean variable and use it.

none of the list function seem to work.. Empty() also doesnt work. Are functions not valid to be used in VF pages?

Best Answer

Take the () off the end of size so it reads

wrapperList.size not wrapperList.size()

Related Topic