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
hramanihramani 

Get the count based on a IF condition on a VF

I have a VF component which has a controller where I’m calculating the no of records and storing the value in an Integer (get set) named resultCount.
I want to display that based on a condition something like     
1. if results are 50, show “Displaying first 50 results”
2. if results are less than 50, show “Displaying N results” (N is the exact number found)

For this I’m using the below statement, but it is not working,
Can someone help please.

<apex:outputLabel value="{!IF(!resultCount < 50,’Displaying {!resultCount} Results’,’Displaying first {!resultCount} Results')}" />

 
Preetilata PatilPreetilata Patil
Here i think you are using '!' operators 2 times, so its considering your condition in negative way..this might work for you.
<apex:outputLabel value="{!IF(resultCount < 50,’Displaying {!resultCount} Results’,’Displaying first {!resultCount} Results')}" />