I am having a small issue while assigning a value to custom picklist in my VF.
I am storing values (0 or 1) in a custom field (Match_Filter__c
).
With my logic I am able to get the value of above custome field, and also able to assign it to crit.reportingMatch
.
But, still the value ofcrit.reportingMatch
isn't upadting with the value which we set in class. It is still showing '- Reporting Match Filter -' in VF page.
Our expected result is : If crit.reportingMatch
is 1 or 0, cutom picklist also shoud be updated accordingly.
VF
<apex:pageBlockSectionItem >
<apex:outputText >Match Filter</apex:outputText>
<apex:selectList value="{!crit.reportingMatch}" size="1">
<apex:selectOptions value="{!crit.reportingMatchPicklist}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
Controller Class
public with sharing class massOppController {
public massOppCriteria Crit{get; set;}
// Assigning filterRec.Match_Filter__c value(either 0 or 1) to crit.reportingMatch
crit.reportingMatch = String.valueOf(filterRec.Match_Filter__c);
massOppCriteria Class
public String reportingMatch {get;set;}
public static LIST<SelectOption> getReportingMatchPickList() {
List<SelectOption> reportingMatchPickList = new List<SelectOption>();
reportingMatchPickList.add(new selectoption('', '- Reporting Match Filter -'));
reportingMatchPickList.add(new selectoption('0', '0'));
reportingMatchPickList.add(new selectoption('1', '1'));
return reportingMatchPickList;
}