+ Start a Discussion
praveenpropraveenpro 

i have one task like when i click checkbox i want display pick list in vf page ?

<p>i have one task like when i click checkbox i want display pick list in vf page</p>

Chamil MadusankaChamil Madusanka

Try following example

 

<apex:page controller="TestPage15Controller">

    
  
  <apex:form >
      
  
      <apex:inputCheckbox value="{!checked}" >
          <apex:actionSupport event="onclick" action="{!showPickList}" reRender="pick"/>
      </apex:inputCheckbox>
      
      <apex:selectList id="pick" size="1" disabled="{!displayPickList}">
          <apex:selectOption itemLabel="One" itemValue="One"></apex:selectOption>
           <apex:selectOption itemLabel="two" itemValue="two"></apex:selectOption>
            <apex:selectOption itemLabel="Three" itemValue="Three"></apex:selectOption>
      </apex:selectList>
  </apex:form>
</apex:page>

 

public with sharing class TestPage15Controller {
    public Boolean checked{get;set;}
     public Boolean displayPickList{get;set;}
    
    public TestPage15Controller ()
    {
        checked = false;
        displayPickList = true;
    }
    
    public void showPickList()
    {
        if(checked)
        {
            displayPickList = false;
        }
        else
        {
            displayPickList = true;
        }
    }
}

 If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

Abhay AroraAbhay Arora