Add Folder Tool to Custom or Standard Form (EBS)
Thursday, January 14th, 2010 by Ashot Manukyan
Add Folder tool in custom or Standard form
In this example I am using a custom form to add Folder tool.
1.      Attach APPFLDR.pll (remove path)
2.      Check out APPDAYPK.pll is attached else copy it from APPSTAND.fmb
3.      Open APPSTAND.fmb (resides in $AU_TOP/Resource). Drag and drop from Object Group of APPSTAND.fmb Standard Folder group to your Object Groups. On popup click button Subclass (you may also copy it but it’s not recommended). It will copy new blocks, canvases and other necessary object to your form.
4.      First save your form, close it, and then close standard_object form.
5.      Create parameter BLOCK_NAME_record_count. Say your main block is LINES then you need to create Parameter named LINES_RECORD_COUNT. Datatype number. This block contains columns to be displayed in folder tool.
6.      You need 2 canvases. Create one content canvas (i.e. LINES_CONTENT) and inside of this add another stacked canvas (i.e. LINES_STACKED). Both canvases of course must have the same window.
7.      Main block:
a.      Items of main block should be on stacked canvas
b.     Should have item called CURRENT_RECORD_INDICATOR, subclass: current_record_indicator, Canvas: LINES_CONTENT. The name of this item is important to be exactly typed otherwise folder tool do not act properly when the window is resized.
c.      Should have an item called folder_switch subclass switcher, Visible:No.
d.     Block Properties: subclass: Block, Scrollbar: yes, Canvas: LINES_CONTENT, Orientation:vertical. (optionally Scroll Bar Width: 0.2)
e.     Items that will be displayed on the folder canvas should have the same location X / Y + .25 which is the height of the Prompt field, plus have to be visible and have the name of Canvas Stacked
f.       Main Block Triggers
WHEN-NEW-BLOCK-INSTANCE
app_folder.event(’WHEN-NEW-BLOCK-INSTANCE’);
KEY-PREV-ITEM
if (:parameter.LINES_record_count = 1) then
previous_item;
else
app_folder.event(’KEY-PREV-ITEM’);
end if;
KEY-NEXT-ITEM
if (:parameter.LINES_record_count = 1) then
next_item;
else
app_folder.event(’KEY-NEXT-ITEM’);
end if;
PRE-BLOCK
app_folder.event(’PRE-BLOCK’);
POST-BLOCK
app_folder.event(’POST-BLOCK’);
PRE-QUERY
app_folder.event(’PRE-QUERY’);
KEY-EXEQRY
app_folder.event(’KEY-EXEQRY’);
POST-QUERY
app_folder.event(’POST-QUERY’);
FOLDER_RETURN_ACTION (Create user named trigger with this name)
/* here you can manage item properties
i.e. queriable property off*/
IF (:global.folder_action = ‘SHOW-FIELD’ ) THEN
app_item_property.set_property('’||’.'||
name_in(’global.folder_field’),Queryable, PROPERTY_OFF);
END IF;
8.      PROMPT BLOCK: i.e. LINES_PROMPT
a.      Properties
i.     Subclass: Block
       ii.     Show Scroll Bar: No
b.     Items
       i.      ORDER_BY1        Clase: Folder_OrderBy
NO Visible Canvas: LINES_STACKED
       ii.      ORDER_BY2        Clase: Folder_OrderBY
NO Visible Canvas: LINES_STACKED
       iii.     ORDER_BY3        Clase: Folder_OrderBY
NO Visible Canvas: LINES_STACKED
       iv.     FOLDER_OPEN      Clase: Folder_Open
Visible:Yes Canvas: LINES_CONTENT
       v.     FOLDER_TITLE     Clase: Dinamic_Title
Visible:Yes Canvas: LINES_CONTENT
       vi.     FOLDER_DUMMY     Class: Folder_Dummy
Visible:Yes Canvas: Toolbar
9.      Prompt Items
  a.      You must have the same field name of the Block FOLDER (LINES) and must appear in the same order they are sorted in this.
       i.      Class: Folder_Prompt_Multirow
       ii.      Initial value: Prompt you want to have the field.
       iii.      Visible: YES / NO depending on the case if the field appears as visible or not in the folder.
       iv.     Canvas: Stacked canvas (LINES_STACKED)
       v.     Position X / Y: Everyone should have the same location.
10.  Form Level Triggers       a.      FOLDER_ACTION
app_folder.event(:global.folder_action);
       b.     WHEN-NEW-FORM-INSTANCE
app_folder.define_folder_block(’ XXPETLINES12345′, — ‘Object Name unique in all applicatios’
‘ LINES’, — ‘folder_block’,
‘ LINES_PROMPT’, — ‘prompt_block’,
‘LINES_STACKED’, –’stacked_canvas’,
‘PETLINES’ Â –’window’
);
      c.      WHEN-WINDOW_RESIZED
if :system.event_window in (’PETLINES’) then
app_folder.event(’WHEN-WINDOW-RESIZED’);
end if;
That’s all.



