You need to sign in to do that
Don't have an account?
Not clear on how to use Rendered
Hello Community,
My requirement is to display a field Provided_Cash_Amount__c if another field Cash_Provided__c only if it is populated as 'Yes'. I believe I can do it using Rendered, which I tried but couldn't get to work. Please look at the code below:
Visualforce Page:
<apex:page standardController="Response_Action_Plan__c" extensions="RapSaver" tabStyle="Response_Action_Plan__c">
<apex:form >
<apex:pageBlock >
<apex:sectionHeader title="New Response Action Plan" />
<apex:pageBlockSection title="Information" collapsible="False" columns="1">
<apex:inputField value="{!RAP.name}"/>
<apex:inputField value="{!RAP.Disaster__c}"/>
<apex:inputField value="{!RAP.Causalities_Attended__c}"/>
<apex:inputField value="{!RAP.Staff_Allotted_Offshore__c}"/>
<apex:inputField value="{!RAP.Staff_Onsite__c}"/>
<apex:inputField value="{!RAP.Onsite_Staff_Count__c}"/>
<apex:inputField value="{!RAP.Blankets_Provided__c}"/>
<apex:inputField value="{!RAP.Number_of_Blankets_Provided__c}"/>
<apex:inputField value="{!RAP.Cash_Provided__c}"/>
<apex:inputField value="{!RAP.Provided_Cash_Amount__c}" rendered="{!IF(RAP.Cash_Provided__c = 'Yes', true, false)}"/>
</apex:pageBlockSection>
<apex:pageblockbuttons location="Bottom" >
<apex:commandbutton value="Save RAP" action="{!RapSaver}"/>
</apex:pageblockbuttons>
</apex:pageBlock>
</apex:form>
</apex:page>
Extension Class:
Public class RapSaver
{
Public Response_Action_Plan__c RAP{get;set;}
Public ApexPages.StandardController Stcl{get;set;}
Public RapSaver(ApexPages.StandardController str)
{
Stcl = str;
}
Public RapSaver()
{
RAP = new Response_Action_Plan__c();
}
Public PageReference RapSaver()
{
insert RAP;
PageReference pg = new PageReference ('/a07?fcf=00B7F000009BsJx');
pg.SetRedirect(true);
return pg;
}
}
Please try this once
Thanks Nayana,
I tried your suggestion but doesn't seem to work. Can you share any other suggestions on this ?
Please refer to the below post
https://salesforce.stackexchange.com/questions/85317/forcing-specific-fields-to-be-visible-based-on-other-fields-value
Thanks