• prangya
  • 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 4

i am new to sfdc .i want to retreive data, monthwise and datewise.i mean i have  fields name, month ,from date and to date.i have created one dropdownlist month .when i select one month suppose january and search it that particular month value will come but datewise.plz urgent reply me

how to create checkbox in visualforce


i used this code

<apex:selectCheckboxes value="{!temp}" />

i have create an apex class

public class sampleCon {
public PageReference setFieldApiName() {
System.debug('field are '+ Apexpages.currentPage().getParameters().get('fieldName'));
return null;
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;


and my visualforce page is 


<apex:page controller="sampleCon">
        <apex:selectList value="{!countries}"  multiselect="true" onchange="setFieldApiName({! countries})"> <apex:selectOptions value="{!items}"/> </apex:selectList><p/> </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:form> <apex:actionRegion > <apex:actionFunction name="setFieldApiName" action="{!setFieldApiName}" reRender="out"> <apex:param value="" name="fieldName"/> </apex:actionFunction> </apex:actionRegion> </apex:form> </apex:page>


when i select an item from the list and actionFunction will be called and from which there is a call to apex class function setFieldApiName i am expecting that country which i selected in debug but getting "field are null" .how to get the country value when it is changed in list please some one explain




I am unable to understand the below program, especially the "{!filterid}" ,  "{!listviewoptions}" and "{!list}" . Are they built-in? What is their functionality? Can you please explain about them in detail.


<apex:page standardController="Account" recordSetVar="accounts">
<apex:selectList value="{!filterid}" size="1">
<apex:selectOptions value="{!listviewoptions}"/>
<apex:commandButton value="Go" action="{!list}"/>


Also I am little bit confused with usage of selectList, can you pls explain it also?


Thanks in advance,


how to create checkbox in visualforce


i used this code

<apex:selectCheckboxes value="{!temp}" />


     can we create an simple calculater application in the apex page.if it s possible in saelsforce..

        help me..

  • January 24, 2012
  • Like
  • 0