FORM开发技术之动态控制某些item的属性
2013-12-14 12:03
344 查看
利用FORM内置函数控制ITEM包括按钮,普通ITEM等等的属性,更多内置函数学习课参考我的博客FORM内置系统函数
http://blog.csdn.net/cai_xingyun/article/details/17167189
http://blog.csdn.net/cai_xingyun/article/details/17167189
PACKAGE BODY ROLE_CONTROL IS procedure set_func_role(role_name in varchar2) is --角色按钮控制 begin case upper(role_name) when 'CUSTOM' then set_item_property('TRN_CONTROL.ADOPT_BUTTON',visible,property_false); set_item_property('TRN_CONTROL.REJECT_BUTTON',visible,property_false); when 'MANAGER' then set_item_property('TRN_CONTROL.SUBMIT_BUTTON',enabled, property_false);--经理进入提交按钮设为enabled set_item_property('TRN_CONTROL.ADOPT_BUTTON',visible,property_true); set_item_property('TRN_CONTROL.REJECT_BUTTON',visible,property_true); else FND_MESSAGE.DEBUG('ROLE_NAME 角色名 不对!'); end case; end set_func_role; procedure set_func_state(role_name in varchar2, order_state in varchar2) is --角色 + 状态 控制增删改 begin case upper(order_state) when 'NEW' then if role_name = 'CUSTOM' then set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_true); --2. 通过角色控制来判断块是否可以删除 set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_true); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_true);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',query_ALLOWED,property_true); --菜单 menu_p.menu_off('cancel'); menu_p.menu_off('close'); menu_p.menu_off('out'); elsif role_name = 'MANAGER' then set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled , property_false); set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled , property_false); --在新建的时候只能进行查询 set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_FALSE); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',query_allowed,property_FALSE); --LINES set_block_property('TRN_ORDER_LINES',insert_allowed,property_false); set_block_property('TRN_ORDER_LINES',update_allowed,property_FALSE); set_block_property('TRN_ORDER_LINES',delete_allowed,property_false); set_block_property('TRN_ORDER_LINES',query_allowed,property_FALSE); --菜单 menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; when 'SUBMITTED' then if role_name = 'CUSTOM' then -- fnd_message.debug('submmit'); set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_false); set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --状态为SUBMITTED的时只能让'取消'订单有效 --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_off('close'); elsif role_name = 'MANAGER' then set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled , property_true); set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled , property_true); -- set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); -- fnd_message.debug('update_allowed_1'); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true);----------------------------------原为ture -- fnd_message.debug('update_allowed_2'); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false); --set_block_property('TRN_ORDER_HEADERS_4810_V',query_allowed,property_true); -- set_item_property('TRN_ORDER_HEADERS.ORDER_STATUS' , update_allowed , property_false); --因为管理员可以进行备注所有把其中的一个ITEM改成可更改 -- fnd_message.debug('VENDOR_NUMBER_update_allowed_false_1'); set_item_property('TRN_ORDER_HEADERS.VENDOR_NUMBER' , update_allowed , property_false); -- fnd_message.debug('VENDOR_NUMBER_update_allowed_false_2'); SYNCHRONIZE; --set_item_property('TRN_ORDER_HEADERS_4810_V.VENDOR_NAME' , enabled , property_false); set_item_property('TRN_ORDER_HEADERS.ORDER_DATE' , enabled , property_false); --set_item_property('TRN_ORDER_HEADERS_4810_V.ORDER_STATUS' , enabled , property_false);--状态时在跳过来就改的,而在这里不能改。 set_item_property('TRN_ORDER_HEADERS.ORDER_NUMBER' , enabled , property_false); --set_item_property('TRN_ORDER_HEADERS_V.ORDER_NUMBER' , insert_allowed , property_false); -- fnd_message.debug('DESCRIPTION_update_allowed_false_1'); set_item_property('TRN_ORDER_HEADERS.DESCRIPTION' , enabled , property_true); -- fnd_message.debug('DESCRIPTION_update_allowed_false_2'); --set_item_property('TRN_ORDER_LINES_4810_V.TOTALMONEY' , enabled , property_false); set_item_property('TRN_ORDER_HEADERS.DF' , enabled , property_false); -- set_item_property('TRN_ORDER_HEADERS_4810_V.DESCRIPTION' , enabled , property_true); --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单 menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; when 'APPROVED' then if role_name = 'CUSTOM' then set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_false); set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --这个里写订单的关闭菜单 menu_p.menu_off('cancel'); elsif role_name = 'MANAGER' then set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled , property_false); set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled , property_false); --块只有查询 set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_FALSE); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单 menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; when 'REJECTED' then if role_name = 'CUSTOM' then set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_true); set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); -- set_block_property('TRN_ORDER_lines_4810_V',update_allowed,property_true); --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_true); set_block_property('TRN_ORDER_LINES',query_ALLOWED,property_true); --写'取消,关闭'菜单 elsif role_name = 'MANAGER' then set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled , property_false); set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled , property_false); --块只能查询 set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_FALSE); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单 menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; when 'CANCELLED' then if role_name = 'CUSTOM' then set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_true); menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); elsif role_name = 'MANAGER' then set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); --set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; when 'CLOSED' then if role_name = 'CUSTOM' then set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_false); set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_HEADERS',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_HEADERS',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_HEADERS',DELETE_ALLOWED,property_false); menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); elsif role_name = 'MANAGER' then set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',update_allowed,property_false); set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改 set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); --lines --LINES set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false); set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false); -- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_OFF('cancel'); menu_p.menu_OFF('close'); end if; else GO_BLOCK('TRN_ORDER_HEADERS'); end case; end set_func_state; END;
相关文章推荐
- FORM开发技术之动态控制某些item的属性
- FORM开发技术之动态控制某些item的属性
- 如何在dropdownlist动态添加item之后,如何设置其value值! /用JS控制服务端dropDownlist和textField的Readonly属性
- 关于使用ant-design设计可动态添加FormItem的过程中遇到的问题记录。
- 巧用CSS动态控制文本的属性
- CFormView动态调整对话框的尺寸和调整比例控制的部署
- Form FormItem的水平、垂直间距控制
- json动态过滤某些属性 之@jsonignore
- 插件化开发—动态加载技术加载已安装和未安装的apk
- jquery动态改变form属性提交表单
- Google最新开发技术动态 (中字视频)
- JSP简介以及常见动态网站开发技术(Asp.net、Php、Jsp)
- FORM开发两种方式实现动态LIST
- 项目开发管理技术之项目版本控制、软件建模、软件测试、项目文档管理(转)
- Android开发中动态获取RecyclerView的Item中EditText的内容
- form 表单域的动态设计-customized tab information 模块代码开发总结(1)
- EBS开发_Form开发中组件权限控制的几个常用方法
- 删除子窗体中的控件中的某些属性时出现"Selection contains a component introduced in an ancestor form which cannot be deleted."错误的解决方法
- 插件化开发—动态加载技术加载已安装和未安装的apk
- FORM开发两种方式实现动态LIST