i have a pageblock that i want will renderd if my list has one value for this i tried

rendered="{!lowesPortalTranscations.size == 1}" 

and my list has only one value but it is laso rendering when list is null, how i check this condition?

  • can you post the code behind your list/ are you limiting the list to 1? – Rao Jun 7 '17 at 21:25

create a boolean attribute in Controller

and based on List size make it true.

public boolean displayList {get;set;}
public void prepareList()
    List<Account> acctList = [SELECT ...... FROM Account... LIMIT 1];
        displayList  = true;


<apex:pageblock rendered="{!displayList}">
| improve this answer | |
  • Thank you santanu it is working perfectly for me.Thanks a lot!! – sonam mittal Jun 7 '17 at 21:34

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.