function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
HI,
how to create a dropdownlist in apex and i want to get the values into it dynamically. please help me.
Regards,
kranthi nagisetty
The selected value is applied to the controller through a merge field on the value attribute.
E.g.
Controller
public String selected {get; set;}
Page
<apex:selectList value="{!selected}"> <apex:selectOptions value="{!options}"/> </apex:selectList>
You can build the list of selectoptions that are available to the list via apex.
E.g. controller
public List<SelectOption> getOptions() { List<SelectOption> options=new List<SelectOption>(); list.add(new SelectOption('MyValue1', 'MyLabel1'); list.add(new SelectOption('MyValue2', 'MyLabel2'); list.add(new SelectOption('MyValue3', 'MyLabel3'); return options; }
Page:
<apex:selectList value="{!mySelectedOption}"> <apex:selectOptions value="{!options}"/> </apex:selectList>
Thanks bob,
i got the binding but how to get the selected value and i want to save the selected value of dropdown into database please suggest how can i do this
Ok thanks ,
My issue resolved
The selected value is applied to the controller through a merge field on the value attribute.
E.g.
Controller
Page
All Answers
You can build the list of selectoptions that are available to the list via apex.
E.g. controller
Page:
Thanks bob,
i got the binding but how to get the selected value and i want to save the selected value of dropdown into database please suggest how can i do this
The selected value is applied to the controller through a merge field on the value attribute.
E.g.
Controller
Page
Ok thanks ,
My issue resolved