I have a picklist type outputfield on my visualforce page, i want when i select any value from this field some field will hide as per selected value.

<apex:outputField value="{!oFormobject.C_Item_Married__c }" rendered="{!CONTAINS(sApiName, 'G2C_Item_Married__cN')}">
          <apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
          <apex:actionSupport event="onchange" reRender="personalInfo" />

Thanks in Advance.


As you want to allow users to change picklist options that mean your picklist need to be inputField so user can update it. Here is quick example to how how you can do it with actionSupport

<apex:page controller="ActionSupportDemoCtrl">
<apex:pageBlock id="personalInfo">

  <apex:inputField value="{!acc.Type}"/>
  <apex:actionSupport event="onchange" reRender="personalInfo" action="{!doSomething}" status="mystatus">

<apex:actionStatus id="mystatus" startText=" (Working...)" stoptext="Done!"/>  


public class ActionSupportDemoCtrl{
 public Account acc{get;set;}
 public ActionSupportDemoCtrl() {
       acc = [Select ID,Type From Account Limit 1];

 public PageReference doSomething() {
     acc.Type ='New value';
     return null;

Here is official link of action support doc


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.