You need to sign in to do that
Don't have an account?
paddybilli
multiselect picklist values
Hi,
How to insert the multiple values from picklist using visualforce and apex .
Thanks,
paddybilli
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi,
How to insert the multiple values from picklist using visualforce and apex .
Thanks,
paddybilli
Multi-select picklist values are stored as a semicolon separated string.
Thus to set a value via apex containing options 'a', 'b and 'c', you'd have something like:
<apex:page controller="sampleCon3">
<apex:form >
<apex:selectList value="{!countries}" multiselect="true">
<apex:selectOptions value="{!items}"/>
</apex:selectList><p/>
<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
</apex:form>
<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">
<apex:facet name="stop">
<apex:outputPanel >
<p>You have selected:</p>
<apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
</apex:outputPanel>
</apex:facet>
</apex:actionstatus>
</apex:outputPanel>
</apex:page>
class:====
=====
public class sampleCon3 {
String[] countries = new String[]{};
public PageReference test() {
return null;
}
public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;
}
public String[] getCountries() {
return countries;
}
public void setCountries(String[] countries) {
this.countries = countries;
}
}
Hi,
How to insert the Dynamic values.
Regards,
Paddy Billi