I wrote a java script to change background color of the title to green.But it does not seem to be working because of some reason i am unaware of.
Below is the VF page
<apex:page controller="AccountSummaryReportController" action="{!loadKeyAccounts}" > <script> function colorPageBlock(pageblock, color) { if (pageblock != null) pageblock.firstChild.style.cssText = “background-color: ” + color + “; } </script> <apex:sectionHeader title="Account Summary Report as of : " description="This Report Shows Records modified in last 31 days"/> <apex:form > <apex:repeat value="{!objectMap }" var="ProgNameKey"> <apex:pageBlock title="{!ProgNameKey}"> <apex:repeat value="{!objectMap [ProgNameKey]}" var="PlanNameKey"> <apex:pageBlockSection title="{!PlanNameKey}" columns="1" id="greenSection" > <script>colorPageBlock(document.getElementById("{!$Component.greenSection}"), "green");</script> <apex:pageBlockTable value="{!objectMap [ProgNameKey][PlanNameKey]}" var="lstGrnRate" border="1" columnsWidth="20%,10%,70%"> <apex:column value="{!lstGrnRate.Account__r.Name}"/> <apex:column value="{!lstGrnRate.Status__c }"/> <apex:column value="{!lstGrnRate.Account_Summary__c}"/> </apex:pageBlockTable> </apex:pageBlocksection> </apex:repeat> </apex:pageBlock> </apex:repeat> </apex:form> </apex:page>
document.getElementById("{!$Component.greenSection}")