【问题标题】:Visualforce page custom filterVisualforce 页面自定义过滤器
【发布时间】:2015-07-06 16:23:52
【问题描述】:

我有一个对象,比如说“资源” 每个对象都有类型,比如说“承包商” 每个“承包商”可能有子类型 A、B、C、D

我有将所有“承包商”输出为表格的 visualforce 页面设置,但我还希望有带有 A、B、C、D 值的子类型下拉列表,并带有过滤承包商的选项(比如说,我选择“A ', 页面会被刷新,所有子类型A的承包商都会出现)。

类型和子类型是相关列表(类型是子类型的控制字段)

非常感谢您的帮助。

谢谢。

【问题讨论】:

    标签: salesforce apex-code visualforce


    【解决方案1】:

    我遇到了同样的问题,这就是我开发它的方式。

    你的视觉力量页面:

     <apex:outputPanel id="PanelId">
        <apex:selectList size="1"  id="firstList" value="{!firstListVauleId}">              
            <apex:actionSupport event="onchange" action="{!UpdateSelectedFirstItem}" reRender="PanelId"/>
            <apex:selectOptions value="{!FirstListOptions}" />
          </apex:selectList>
    
    
          <apex:selectList size="1"  id="secondList" value="{!secondValueId}">              
            <apex:selectOptions value="{!SecondListOptions}" />
          </apex:selectList>
    
      </apex:outputPanel>
    

    你的顶级课程:

    public String firstListVauleId {get;set;}
    public String secondListVauleId {get;set;}
    public List<SelectOption> getfirstListOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        // add items add needed. you can make database queries.
        return options;
    }
    
    public List<SelectOption> getsecondListOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        // add options based on the first list selection. you can make database queries.
        return options;
    }
    
    
    public void UpdateSelectedFirstItem()
    {
        // do your stuff if you need to do anything upon changing the first dropdown selected item. 
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 2014-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多