2

Hi Visualforce experts:

Is it possible to dynamically resize a Visualforce Page based on a specific condition? For example, on my page - warning #2 is displayed only when a condition is met.

If this condition is not met, the warning is not shown.

Warning #1 is always static/does not change.

I would like to essentially resize my page when the condition is not met.

<apex:page standardController="Opportunity"
extensions="OpportunityControllerExtension">

<apex:stylesheet value="{!$Resource.alerts}"/>
<apex:stylesheet value="{!$Resource.infoIcon}"/>

<warning>
<img src="{!$Resource.infoIcon}" border="0"/> 
<apex:outputLabel value="Opportunities may be submitted for Approval and/or    
Resource Assignment at Stage 3 or later.">
</apex:outputLabel> 
</warning>

<apex:form rendered="{!Opportunity.Account.NumberOfEmployees == 0}">

<apex:stylesheet value="{!$Resource.alerts}"/>
<apex:stylesheet value="{!$Resource.infoIcon}"/>

<warning>
<img src="{!$Resource.infoIcon}"border="0"/> 
<apex:outputLabel value="Please populate the Number of Employees on the "><a   

href="/{!opportunity.AccountId}/e?retURL={!opportunity.Id}" title = "Click   
here to go Edit the Account" target="_blank">{!opportunity.Account.Name}</a>   
Account before moving forward.
</apex:outputLabel>      
</warning>

</apex:form>

</apex:page>

enter image description here enter image description here

SFDC-ThEq
  • 89
  • 1
  • 9

1 Answers1

3

This functionality is no longer possible since Salesforce stopped allowing sidebar javascript.

Adrian Larson
  • 149,971
  • 38
  • 239
  • 420