+ Start a Discussion
Amita TatarAmita Tatar 

rendering a field in vF page when checkbox value on standard page layout is changed

I want to render a particular field in VF page when checkbox field on detail page will be checked. How i should do it? please help

Amita Tatar

sharathchandra thukkanisharathchandra thukkani
this is not possible but the work arounds would be

Workaround 1:
after checking the check box and user do save the record then you can provide a button or link on the detail page. And on click of that button you can open the VF page with fields you want to display. If not check show a warning message that you need to check the check box to see the fields.

Workaround 2:
after checking the check box and user do save the record then change the record type of the record using workflow and assign a different page layout to the changed record type where you can show the field.
Jerun JoseJerun Jose
Hi Amita,

In a visualforce page you can use the AJAX components to conditionally show/hide sections or elements of the page. Please refer to the following tags in the visualforce developer guide.

You will also need to get a clear understanding of the "Rendered" and "ReRender" attributes that you can find in many of the visualforce tags.

A simple example is available at http://www.oyecode.com/2013/04/how-to-re-render-part-of-visualforce.html

After that have a look at Bob Buzzard's excellent blog post which explains how they work in a simple example.
Shashank Mishra 26Shashank Mishra 26
Hi Amita.

I think below code can conditionally display the VF page based on the checkbox. In rendered you can put if condition

<apex:page standardController="ObjectName"  rendered="{!ObjectName.CheckBoxName==TRUE}" >
     <apex:form >
               ....your data to display