How to check whether a field value in visualforce page is blank or null?

Sample Code:

Visualforce page:

<apex:page controller="Sample">
    <apex:pageblock >
        <apex:pageBlockTable value="{!MembList}" var="M">
            <apex:column value="{!M.Name}"/>
            <apex:column >
                <apex:outputText value="{! IF((M.Age__c == null), 'NA', M.Age__c) }"/>

Apex Controller:

public class Sample {  
    public List<Member__c> MembList {get;set;}
    public Sample() {
        MembList = [SELECT Name, Age__c FROM Member__c];


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit