标签:
编写触发器
WHEN-NEW-BLOCK-INSTANCE | app_folder.event(‘WHEN-NEW-BLOCK-INSTANCE’); |
WHEN-NEW-RECORD-INSTANCE | app_folder.event(‘WHEN-NEW-RECORD-INSTANCE’); |
KEY-PREV-ITEM | app_folder.event(‘KEY-PREV-ITEM’); |
KEY-NEXT-ITEM | app_folder.event(‘KEY-NEXT-ITEM’); |
KEY-EXEQRY | app_folder.event(‘KEY-EXEQRY’); |
PRE-QUERY | app_folder.event(‘PRE-QUERY’); |
PRE-BLOCK | app_folder.event(‘PRE-BLOCK’); |
POST-BLOCK | app_folder.event(‘POST-BLOCK’); |
POST-QUERY | app_folder.event(‘OST-QUERY’); |
KEY-ENTQRY | app_folder.event(‘EY-ENTQRY’); |
KEY-PRVREC | app_folder.event(‘KEY-PRVREC’); |
KEY-NXTREC | app_folder.event(‘KEY-NXTREC’); |
KEY-CLRREC | app_folder.event(‘KEY-CLRREC’); |
KEY-CLRBLK | app_folder.event(‘KEY-CLRBLK’); |
创建提示块:XXX_PROMPT
Name | Subclass |
FOLDER_TITLE | DYNAMIC_TITLE |
FOLDER_OPEN | FOLDER_OPEN |
FOLDER_DUMMY | FOLDER_DUMMY |
ORDER_BY1 | FOLDER_ORDERBY |
ORDER_BY2 | FOLDER_ORDERBY |
ORDER_BY3 | FOLDER_ORDERBY |
上面列出的是通用的,数据块有多少字段要显示,就要创建多少个同名的提示字段(带文件夹的表单,数据的头其实也是字段,只补过内容是固定的)。
设置布局(只有堆叠画布上的项才能使用文件夹)
设置FORM级触发器
在FOLDER_ACTION中追加:
app_folder.event(:global.folder_action);
在KEY-CLRFRM中追加:
app_folder.event(‘KEY-CLRFRM‘);
在WHEN-WINDOW-RESIZED中追加,注意BLOCKNAME,要改为你的Folder所在的Window名字:
DECLARE
l_x_position NUMBER;
l_width NUMBER;
BEGIN
IF :system.event_window IN (‘DEMO_FOLDER‘) THEN
app_folder.event(‘WHEN-WINDOW-RESIZED‘);
l_width := get_view_property(‘DEMO_FOLDER_CONTENT‘, width);
set_canvas_property(‘DEMO_FOLDER_CONTENT‘, width, l_width);
l_width := get_view_property(‘DEMO_FOLDER_STACK‘, width);
l_x_position := get_view_property(‘DEMO_FOLDER_STACK‘, viewport_x_pos);
l_x_position := l_x_position + l_width + 0.015;
set_block_property(‘DEMO_FOLDER‘, blockscrollbar_x_pos, l_x_position);
END IF;
END;
注意必须用代码对内容画布进行调整,因为改变窗口大小时,Form不会自动调整。
在WHEN-NEW-FORM-INSTANCE中追加:
app_folder.define_folder_block(object_name => ‘DEMO_FOLDER‘,
folder_block_name => ‘DEMO_FOLDER‘,
prompt_block_name => ‘DEMO_PROMPT‘,
folder_canvas_name => ‘DEMO_FOLDER_STACK‘,
folder_window_name => ‘DEMO_FOLDER‘,
disabled_functions => ‘‘,
tab_canvas_name => ‘‘,
fixed_canvas_name => ‘‘);
app_folder.event(‘INSTANTIATE‘);
show_view(‘DEMO_FOLDER_CONTENT‘);
第一句是Folder申明,根据参数名给出具体值即可,注意tab_canvas_name,我们不用Tab页,所以为空。
最后一句是因为本例中内容画布上没有可导航的块,所以需要用带码使其显示。
标签:
原文地址:http://www.cnblogs.com/jforce/p/5602205.html