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
Jagadeesh AdaveniJagadeesh Adaveni 

Could you Please help me it looks too urgent.. How to render block based picklist value selection

Hi All,

I have Payment_Mode__c Multiselect picklist field with values (ACH,Check,Credit Card) in Location__C object.
I have Student__c object is lookup to Location__c, here i have created picklist in VF with values ACH,Check,Credit Card.
VF page

<apex:selectList value="{!svalue}" size="1">
                   <apex:outputLabel value="{!$ObjectType.Student__c.fields.Payment_Mode__c.label}"></apex:outputLabel>
                    <apex:selectOptions Value="{!picklistFunction}"></apex:selectOptions> 

---------------public list<student__c> studentList{get;set;}
    public list<selectoption> lstoption{get;set;}
    public String sValue{get;set;}
    public List<selectOption> getpicklistFunction()
    List<selectOption> studentName =new List<selectOption>();
        List<Student__c> studentList = new List<Student__c>();
        List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c where name='Shiva 1'];
        for(Student__c st : stuList)
            st.payment_mode__c = st.Location__r.Payment_Mode__c;
             studentName.add(new selectOption('Check','Check'));
             if(st.Location__r.Payment_Mode__c.contains('Credit Card'))
             studentName.add(new selectOption('Credit Card','Credit Card'));
             studentName.add(new selectOption('ACH','ACH'));
        return studentName ;

Output is
Payment Mode(ACH,Check)(because i selected these values in Location__c)

Requirement is in Student Object if i select any picklist value like Check then Check related block need to rendered.

Check Block is like BankName: Check Number: etc fields need to rendered.  

Vishnu VaishnavVishnu Vaishnav
Hi Jagadeesh,

U can use action function.

<apex:actionfunction name="ren" rerender="frm" action="{!your action function}"/>
<apex:selectList onclick="ren(); return false;" value="{!svalue}" size="1">
<apex:outputLabel value="{!$ObjectType.Student__c.fields.Payment_Mode__c.label}"></apex:outputLabel>
<apex:selectOptions Value="{!picklistFunction}">

Qusetion Solved ? then mark as best answer to make helpful to others .....
Jagadeesh AdaveniJagadeesh Adaveni
Hi Vishnu,

My requirement is in Student also i have created on field Payment_mode__c with values(ACH,Check,Credit Card) problem is Whatever the values i selected in Locations only those values should be dispalyed in Student__c.