Type 3:Usage of picklist in vf & Apex


Salesforce23

Exapme: Creating Picklist In Visualforce Page itself

<apex:page controller=”zvf5″ sidebar=”false” showHeader=”false”>
<apex:form >
<apex:selectList value=”{!myVal}” size=”3″ multiselect=”true”>

<apex:selectOption itemvalue=”One” itemlabel=”1″/>
<apex:selectOption itemvalue=”Two” itemlabel=”2″/>
<apex:selectOption itemvalue=”Three” itemlabel=”3″/>
<apex:selectOption itemvalue=”Four” itemlabel=”4″/>
<apex:selectOption itemvalue=”Five” itemlabel=”5″/>
<apex:actionSupport event=”onchange” reRender=”one”/>
</apex:selectList>
<br/>
<apex:outputLabel id=”one”> <b>The selected value is : {!myVal} </b></apex:outputlabel>
</apex:form>
</apex:page>

Controller:
public class zvf5 {

public String myVal { get; set; }
}
one

View original post

Advertisements