function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anuragsinghnsanuragsinghns 

show apex variable in visualforce page

Hi All,
I have an text  I am displaying based on a list size in my visualforce page.I an wondering if it is possible to dislpay a property in the apex code in the visualforce page.
callattemptList is my List based on wether it is empty or not  I want to display two different strings

<apex:pageBlock title="{!if(callattemptList.size>0,'!Username your tasks for the day','!Username not tasks found for you')}" id="theBlock" >
I need to pass the logged in username which is a propert in my apex code unable to find the right syntx for the same any help would be appreciated

Ajay Nagar 7Ajay Nagar 7
Try with two pageblock tags(one with callattemptList.size>0 and other with NOT callattemptList.size>0) and use rendered to evaluate the condition.

<apex:pageBlock title="title 1 for True" id="theBlock1" rendered={!(callattemptList.size>0)} >
<apex:pageBlock title="title 2 for False" id="theBlock2" rendered={!(!callattemptList.size>0)}>