一个简单的下拉列表

实现功能:列出所有的部门,并根据选择的部门名称列出该部门下的所有员工。

1.页面主要代码: 

<af:table value="#{bindings.EmployeesView1.collectionModel}"
                        var="row" rows="#{bindings.EmployeesView1.rangeSize}"
                        emptyText="#{bindings.EmployeesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                        fetchSize="#{bindings.EmployeesView1.rangeSize}"
                        rowBandingInterval="0"
                        filterModel="#{bindings.EmployeesView1Query.queryDescriptor}"
                        queryListener="#{bindings.EmployeesView1Query.processQuery}"
                        filterVisible="true"
   varStatus="vs"  (主要使用这个)
                        selectedRowKeys="#{bindings.EmployeesView1.collectionModel.selectedRow}"
                        selectionListener="#{bindings.EmployeesView1.collectionModel.makeCurrent}"
                        rowSelection="single" id="t1">

在目标字段里加上facet:
<af:column sortProperty="DepartmentId" filterable="true"
                           sortable="true"
                           headerText="#{bindings.EmployeesView1.hints.DepartmentId.label}"
                           id="c11">
                  <af:outputText value="#{row.DepartmentId}" id="ot4">
                    <af:convertNumber groupingUsed="false"
                                      pattern="#{bindings.EmployeesView1.hints.DepartmentId.format}"/>
                  </af:outputText>
  ----------从下面开始---------
                  <f:facet name="filter">
                    <af:selectOneChoice value="#{vs.filterCriteria.DepartmentId}"
                                        label="Label 1" id="soc1">
                      <af:forEach items="#{bindings.DepartmentsView1.rangeSet}"
                                  var="rowlist">
                        <f:selectItem itemLabel="#{rowlist.DepartmentName}"
                                      itemValue="#{rowlist.DepartmentId}"/>
                      </af:forEach>
                    </af:selectOneChoice>
                  </f:facet>
  ----------到上面结束---------
</af:column>

2.加上绑定。
(1)Tab页从Source切换到Bindings,点击绿色加号,在弹出窗体Insert Item里选择tree,点中OK.
(2)在窗体Create Tree Binding中,做一下设置:
 a.Root Data Source:你可以从下拉列表中选择或者点击Add按钮添加。
 b.Tree Level Rules:点击绿色加号按钮添加规则。
 c.Available Attributes:将需要使用的属性从左边弄到右边。点击OK
3.保存and运行页面。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值