You need to sign in to do that
Don't have an account?
rajasfdc
how to create and put dropdownlist in visualforce page?
how to create and put dropdownlist in visualforce page?i mean to say take an example country.no.of countries is there.how to take it as a dropdown or picklist in visaul force page.is there any need to create a custom controller.if it is need.pls clarify this how to create apex class for this purpose in visual force page.pls clarify i will wait.
thanks in advance.
an input field referencing a picklist will present a dropdown box, won't it? For more dynamic population, however, you might need a controller (sometimes dynamic apex). What data features in the dropdown box is important. If the population of the dropdown box is fairly dynamic, then you will probably need a controller.
Hi
Add this code :
<apex:selectList multiselect="false" size="1" value="{!object.Country}" required="false" >
<apex:selectOption itemLabel="India" itemValue=""/>
<apex:selectOption itemLabel="USA" itemValue=""/>
</apex:selectList>
Hope this will helps u.
Regards,
Rajesh.
You can write a controller for your VF page, and expose a property that provides an array of SelectOption object.
much like this:
the VF page
the controller
What if i dont want to hardcore the values
like if i have to create drop down for years from 2000 to 2050 and i don't want to hardcore the years
public void TesterController
I didn't and salesforce was throwing an "Invalid Constructor Name" compile error.