0

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?

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

1 Answer 1

1

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];
    if(acctList.size()==1)
    {
        displayList  = true;
    }
}

Visualforce

<apex:pageblock rendered="{!displayList}">
1
  • Thank you santanu it is working perfectly for me.Thanks a lot!! Jun 7, 2017 at 21:34

You must log in to answer this question.

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