我正在尝试打印 Salesforce 自定义对象数据库并有一个过滤器。过滤器工作正常,但“全部”过滤器不会将完整表显示为默认值,或者当我从另一个过滤器中单击“全部”时。我怎样才能做到这一点?
这是相关的 Apex 代码:
public string itemPickValue{get; set;}
public List<QC_Issue__c> issuesList{get; set;}
public List<QC_Issue__c> results;
public List<QC_Issue__c> getIssues() {
results = Database.query(
'SELECT Component_Category__c, Issue_Name__c, Issue_Description__c, Severity_1_Criteria__c, Severity_2_Criteria__c, Severity_3_Criteria__c, File__c FROM QC_Issue__c Order By Component_Category__c, Issue_Name__c'
);
return results;
}
public void getIssuesList() {
if(itemPickValue.equals('All')) issuesList = Database.query('SELECT Component_Category__c, Issue_Name__c, Issue_Description__c, Severity_1_Criteria__c, Severity_2_Criteria__c, Severity_3_Criteria__c, File__c FROM QC_Issue__c');
issuesList = Database.query('SELECT Component_Category__c, Issue_Name__c, Issue_Description__c, Severity_1_Criteria__c, Severity_2_Criteria__c, Severity_3_Criteria__c, File__c FROM QC_Issue__c WHERE Component_Category__c =: itemPickValue');
}
这是相关的 Visualforce 代码:
<apex:pageBlock title="QC Glossary" id="qc_issues_list">
<h3>Filter by Component Category:</h3>
<br></br>
<!-->Start Filter and List<-->
<apex:selectList size="1" value="{!itemPickValue}">
<apex:actionSupport event="onchange" action="{!getIssuesList}" rerender="table"/>
<apex:selectOption itemLabel="All" itemValue="All"></apex:selectOption>
<apex:selectOption itemLabel="Animation/VFX" itemValue="Animation/VFX"></apex:selectOption>
</apex:selectList>
<br></br>
<br></br>
Qyouu
相关分类