临海小憇

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 4529|回复: 0

自定义下拉框

[复制链接]

100

主题

121

帖子

8552

积分

论坛元老

Rank: 8Rank: 8

积分
8552
发表于 2017-8-1 15:49:18 | 显示全部楼层 |阅读模式

适用版本:1.0.0_20170726

具体参见类:io.raycom.system.framework.tag.form。DemoExtendSelector


说明:

1:创建下拉框扩展类:

  1)创建类实现SelectTagExtender接口

  2)添加类注解:@Component   用于自动生成对应的bean

  3)添加接口类声明的4个方法的实现。其中

     getItemValue():返回存储下拉框中value的字段名

     getItemLabel():返回存储下拉框中text的字段名

     getComCode():区分扩展类的标识,用于select以及select2标签中comocode属性

     getItems():下拉框中的实际数据,其key值需要与声明的getItemValue,getItemLabel一致。

     

2:使用:

  与常规的通用代码调用方法一致,区别是comcode需要赋的值是扩展类中定义的值,例如

  <rt:select2 id="status"  name="status" dataQuery="yes" headerKey="-1" headerValue="全部"  comCode="demo-code"></rt:select2>


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|临海小憇 ( 鲁ICP备16010828号-2

GMT+8, 2024-3-29 05:27 , Processed in 0.047109 second(s), 7 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表