![](/img/trans.png)
[英]Removing None option in PickList AdaptiveTrackSelection
[英]How to filter a picklist based on the selected value of some other picklist in salesforce
我正在创建一个集成了salesforce SDK的android应用,在salesforce自定义对象中,我有两个选择列表(category__c和sub_category__c),如何根据 salesforce 中类别 _c 的选定值过滤sub_category_ c 。
为category__c选择列表创建onchange事件,该事件将按条件sub_category__c进行过滤。
<apex:inputField value="{!category__c}" >
<apex:actionSupport event="onchange" rerender="subCat">
</apex:inputField>
<apex:selectList value="sub_category__c" id="subCat">
<apex:selectOptions value="{!filteredSubCategories}" />
</apex:selectList>
在控制器上
public void getFilteredSubCategories(){
public List<SelectOption> result = new List<SelectOption>();
for(SelectOption so : allSubCategories){ // dont forget to init allSubCategories in constructor
if(someCriteriaMet) { // add logic
result.add(so)
}
}
return result;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.