function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prad NethasPrad Nethas 

Not able to get the results from vf page related to picklist value

Hi All,

I am not able to get the results when I add the picklist values to controller.
Below is the code - Please sugget me the changes to get the desired results.

<apex:page controller="searchres">
<apex:form >
<apex:pageBlock >
  <apex:sectionHeader title="Search Results"/>
              <apex:pageBlockSection >
           
              <apex:panelGrid columns="2">
                  <apex:outputText value="Country"/>
                  <apex:inputText value="{!country}"/>
                 
                  Qualification<apex:inputField label="Qualification" value="{!ban.Qualification__c}"/>
                  </apex:panelGrid><br/>
                 
                              <!--<apex:selectList title="Qualification" label="Qualification">
                             <apex:selectOptions value="{!TypeOptions}"/>
                            </apex:selectList>-->
                           
                 <apex:commandButton value="Search" action="{!login}"/>
              </apex:pageBlockSection>
              <apex:pageBlockSection >
              <apex:pageBlockTable value="{!bank}" var="bnk">
              <apex:column headerValue="Country" value="{!bnk.Country__c}"/>
              <apex:column headerValue="Qualification" value="{!bnk.Qualification__c}"/>
              </apex:pageBlockTable>
 
              </apex:pageBlockSection>
              </apex:pageBlock>
      </apex:form>
</apex:page>
 ///////////////Controller
public class searchres {
public string country{get;set;}
public string name{get;set;}
public string Qualification{get;set;}
public string quali{get;set;}
 
public list<SOV_Database__c> bank{get;set;}
Public SOV_Database__c ban{get;set;}
//this.stdAcctController = (SOV_Database__c)stdcontroller.getRecord();
public id sh;
    public void login()
    {
       
        bank = [select id,country__c,qualification__c from SOV_Database__c where country__c=:country];
    }
    public List<SelectOption> TypeOptions
   {
        get
        {
            List<SelectOption> options = new List<SelectOption>();
            Schema.DescribeFieldResult fieldResult = SOV_Database__c.country__c.getDescribe();
            List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
   
            for( Schema.PicklistEntry f : ple)
                options.add(new SelectOption(f.getLabel(), f.getValue()));
            return options;
        }
    }
}