I'm new to this so please try to be extra patient with me :) Trying to display an message in the Account layout based on the Account name field. So what I've got working so far is the error message. Now, the problem is that if the message is not displayed (because rendered evaluated to false), it leaves a gaping blank section where the pageblock is. How can I make that section collapse if rendered equals to false? Found a post here that suggested using twistSection but didn't work.
Here's my code:
<apex:page standardController="Account" sidebar="false" showHeader="false" showChat="false"> <apex:pageBlock id="block1" rendered = "{!Account.Name = 'Test'}"> <apex:pageBlockSection id="section1" columns="1" collapsible="true"> <apex:pageMessage summary="Message" severity="warning" strength="3" /> </apex:pageBlockSection> <script> twistSection(document.getElementById('{!$Component.block1.section1}').getElementsByTagName('img')[0]) </script> </apex:pageBlock> </apex:page> Thanks!
apex:outputPanel(surrounding to the pageBlock)?