+ Start a Discussion
Dev2IndiaDev2India 

How to render pageblock and colour if field value exits

Want to display output value and colour page only if field value exists. How to do this on VF ??

<apex:page standardController="Account" showheader="False" id="test" >
    <style>
        .apexp, body .secondaryPalette.bPageBlock, body .individualPalette .secondaryPalette.bPageBlock
        {
            background-color:#F76566;
            color:#000;
        }
        body .bPageBlock .pbBody .labelCol {
            color: #000;
            width:17%;
            font-size:13px;
        }
        .body
        {
            font-size:14px;
            font-weight:bolder;
        }

     </style>
     <apex:form styleClass="form" >
         <apex:pageBlock rendered="true">
             <apex:pageBlockSection columns="1" id="myId" >       
                 <apex:outputText styleclass="body" value="{!account.Imp_msg__c}"  id="myId" />
             </apex:pageBlockSection>
         </apex:pageBlock>
     </apex:form>
</apex:page>

Thanks for the suggestions
Vi$hVi$h
In the pageBlock you could use something like this:
<apex:pageBlock rendered="{!IF(account.Imp_msg__c != ''&& account.Imp_msg__c != null,true,false)}">