You need to sign in to do that
Don't have an account?
kasa venkat 14
picklist value is a header of the page
Hi i have a requirment, i have a multipicklist field with values(India,chaina,usa) if i select any one of this values i want to be header of the page.
for example if i select INDIA and click on save button.it add as a Header of the page.is it possible to do??
thanks for advace
<apex:page controller="customPickListInVFDemoController" tabStyle="Account" >
<apex:form >
<apex:pageBlock id="out">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" rerender="out" status="actStatusId"/>
<apex:actionStatus id="actStatusId">
<apex:facet name="start">
<img src="/img/loading.gif" />
</apex:facet>
</apex:actionStatus>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Target Audiance" collapsible="false">
<apex:selectList value="{!selectedCountry1}" multiselect="True" size="1">
<apex:selectOption itemValue="India" itemLabel="India"/>
<apex:selectOption itemValue="usa" itemLabel="usa"/>
</apex:selectList>
<apex:outputText value="{!selectedCountry1}" label="You have selected:"/>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
public class customPickListInVFDemoController {
public String selectedCountry1{get;set;}
public String selectedCountry2{get;set;}
public customPickListInVFDemoController(){
}
public List<SelectOption> getCountriesOptions() {
List<SelectOption> countryOptions = new List<SelectOption>();
countryOptions.add(new SelectOption('india','india'));
countryOptions.add(new SelectOption('usa','usa'));
return countryOptions;
}
public PageReference save(){
return null;
}
}
for example if i select INDIA and click on save button.it add as a Header of the page.is it possible to do??
thanks for advace
<apex:page controller="customPickListInVFDemoController" tabStyle="Account" >
<apex:form >
<apex:pageBlock id="out">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" rerender="out" status="actStatusId"/>
<apex:actionStatus id="actStatusId">
<apex:facet name="start">
<img src="/img/loading.gif" />
</apex:facet>
</apex:actionStatus>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Target Audiance" collapsible="false">
<apex:selectList value="{!selectedCountry1}" multiselect="True" size="1">
<apex:selectOption itemValue="India" itemLabel="India"/>
<apex:selectOption itemValue="usa" itemLabel="usa"/>
</apex:selectList>
<apex:outputText value="{!selectedCountry1}" label="You have selected:"/>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
public class customPickListInVFDemoController {
public String selectedCountry1{get;set;}
public String selectedCountry2{get;set;}
public customPickListInVFDemoController(){
}
public List<SelectOption> getCountriesOptions() {
List<SelectOption> countryOptions = new List<SelectOption>();
countryOptions.add(new SelectOption('india','india'));
countryOptions.add(new SelectOption('usa','usa'));
return countryOptions;
}
public PageReference save(){
return null;
}
}
replace this code in your account
If any issue ask me .
Regards ,
harish.R
All Answers
replace this code in your account
If any issue ask me .
Regards ,
harish.R
is it working .
Regards ,
Harish.R.
it works but my field is multipicklist.
Change Code hedder value as selectedCountry1 in sectionhedder .
Regards ,
Harish.R
Upadte This Vf page In your Org
If u have any issue ask me imediatly . If it is usefull make it as solved .
Regards ,
Harish.R
im unable to select morethan one country
<apex:sectionHeader title="selectedCountry1" subtitle="{!country}" />
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" rerender="out" status="actStatusId"/>
<apex:actionStatus id="actStatusId">
<apex:facet name="start">
<img src="/img/loading.gif" />
</apex:facet>
</apex:actionStatus>
so this is the functionality you r using for selected value as a Header right.
Please use below code .
Regards ,
Harish.R.
thats fine.
Any Issue or errors ask me harish.rao.salesforce@gmail.com .
Regards ,
Harish.R