TOPGP5.3:combobox动态下拉
来源:互联网 发布:erp系统属于数据库 编辑:程序博客网 时间:2024/06/01 22:10
一、前言
开发和维护TOPGP多年,一直觉得这个系统中的下拉框直接固定写死在4fd画面档中,是个非常恶心的设计,这个过程中也一直有浮现过想要自己写一个动态下拉框动态配置档的想法,但是一直拖着,终于在前段时间写了。
以下就按部就班,将开发过程写出来,其实非常简单的一个东西,早在几年前就应该做了。
二、建立数据表
/*================================================================================檔案代號:tc_dic_file檔案名稱:下拉列表数据字典檔案目的:上游檔案:下游檔案:檔案類型:B多語系檔案:N============.========================.==========================================*/create table tc_dic_file(tc_dic001 varchar2(10) NOT NULL, /*所属程序代号 */tc_dic002 varchar2(10) NOT NULL, /*字段代号 */tc_dic003 number(5) NOT NULL, /*序号 */tc_dic004 varchar2(10), /*Value */tc_dic005 varchar2(255), /*Item */tc_dicacti varchar2(1) /*资料有效码 */);alter table tc_dic_file add constraint tpc_dic_pk primary key (tc_dic001,tc_dic002,tc_dic003) enable validate;grant select on tc_dic_file to tiptopgp;grant update on tc_dic_file to tiptopgp;grant delete on tc_dic_file to tiptopgp;grant insert on tc_dic_file to tiptopgp;grant index on tc_dic_file to public;grant select on tc_dic_file to ods;
三、建立画面档4fd
注:整合在文章尾部资源下载链接中
四、建立程序代码4gl
注:整合在文章尾部资源下载链接中
五、共用初始化函数4gl
1、代码片段
# Prog. Version..: '5.30.15-14.10.14(00000)' ### Program name...: cl_set_combo_items_gae.4gl# Descriptions...: 動態設定ComboBox的Item.# Date & Author..: 17/07/24 by zhengzrDATABASE ds GLOBALS "../../config/top.global"FUNCTION cl_set_combo_items_plus(ps_field_name,p_tc_dic001,p_tc_dic002) DEFINE ps_field_name STRING DEFINE p_tc_dic001 LIKE tc_dic_file.tc_dic001 DEFINE p_tc_dic002 LIKE tc_dic_file.tc_dic002 DEFINE l_sql STRING DEFINE ps_values LIKE ze_file.ze03 DEFINE ps_items LIKE ze_file.ze03 WHENEVER ERROR CALL cl_err_msg_log LET l_sql = "SELECT to_char(wm_concat(tc_dic004)),to_char(wm_concat(tc_dic004||':'||tc_dic005)) ", " FROM tc_dic_file ", " WHERE tc_dic001='",p_tc_dic001,"' ", " AND tc_dic002 = '",p_tc_dic002,"' ", " ORDER BY tc_dic003 " PREPARE pre_001 FROM l_sql EXECUTE pre_001 INTO ps_values,ps_items CALL cl_set_combo_items(ps_field_name, ps_values, ps_items)END FUNCTION
2、函数说明
cl_set_combo_items_plus(ps_field_name,p_tc_dic001,p_tc_dic002)
参数说明:
ps_field_name:当前画面上需要设置动态下拉的“字段代号”
p_tc_dic001:cooi800中设置的“所属程序代号”
p_tc_dic002:cooi800中设置的“字段代号”
六、使用演示
1、设置动态下拉项目
2、在4GL代码中增加初始化代码
3、效果展示
七、下载链接
1、动态下拉框数据表建立schema
2、动态下拉框配置档4gl逻辑代码
3、动态下拉框配置档4fd画面代码
4、动态下拉框公用初始化函数4gl代码
阅读全文
0 0
- TOPGP5.3:combobox动态下拉
- Ext Combobox 动态下拉树实现
- 动态创建下拉列表框ComboBox
- ExtJs ComboBox 动态创建下拉框
- TOPGP5.3:p_link增加编译、链接功能
- # winform comboBox动态下拉列表,comboBox动态绑定数据库里的数据
- Ext.form.ComboBox 动态加载数据后设置下拉选项
- Ext.form.field.ComboBox下拉项动态改变
- jQuery-easyui中的combobox如何动态获取下拉框内容
- Extjs4学习笔记(七)----combobox下拉动态树
- combobox 动态绑定数据源,利用EasyUI的 combobox插件实现类似百度下拉提示信息
- 下拉列表:comboBox控件
- ComboBox下拉显示
- 美化ComboBox下拉
- combobox下拉表格
- ComboBox下拉列表
- EXTjs 禁止comboBox 下拉
- ExtJs combobox 下拉图标
- 国内外公有云对比:功能介绍、性能测试
- NGUI AnchorPoint与Camera CullingMask的结合之痛
- 如何控制Java代码向数据库中插入数据
- Refletion2017.9.4
- 数据结构线性表
- TOPGP5.3:combobox动态下拉
- HDU 6186 前缀后缀
- c++调用shell & shell调用python
- 弱鸡,C# System.Timers.Timer测试
- CodeForces 431# div.2 A Odds and Ends 暴力 贪心
- virtual box虚拟机安装+ubuntu14.04系统安装+GCC4.8编译器安装
- 城市正视图,紫书P132UVa221
- HDU —2012 素数判定
- python 模拟链表