function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vnbhargavivnbhargavi 

dispaly the records based on the picklist

i have one custom field of picklist type....i have to display the field on the vf page and baesd on the selection of picklist value i have to dispaly the set of records...so how can i do this can anyone help me in this...

 

 

example :pickist values:1

                                             2

                                            3

                                             4

 

if we select '1',dislapy the records with pickist value 1....similarly for all.......................how can i do................................................???

please let me know..................................................

cloudmaniacloudmania

Alot of workaround about this but try to implement below.

//Controller

public class MyCon

{

public MyCon()

      {}

public PageReference DummyAction()

{

    return null;

}

}

//VF

<apex:page controller="MyCon">

<apex:form>

       <apex:actionfunction name="MyAct" a

<apex:inputfield value="MyCustomPick__c" onchange="MyAct">

<apex:actionsupport event="onchange" action="DummyAction" reRender="panel1"/> 

</apex:inputfield>

 

<apex:outputpanel id="panel1">

<apex:inputField rendered="{!IF(MyCustomPick__c==1,true,false)}/>

               <apex:inputField rendered="{!IF(MyCustomPick__c==2,true,false)}/> 

<apex:inputField rendered="{!IF(MyCustomPick__c==3,true,false)}/>

<apex:inputField rendered="{!IF(MyCustomPick__c==4,true,false)}/>

        </apex:outputpanel>

      </apex:form>

</apex:page>