Editable Help

I have now delivered a number of Apex applications into production and have to say that as much as I like the item help functionality in Apex, I have never actually taken the time to fill each item with anything particularly useful. The Apex team are as bad with their item help which usually re-words the the label text. A better solution would be to have the ability to edit the item help whilst the application is in production, thus allowing users to add their own help information when required. Forum question

Solution

This demo application has 2 users: a standard user and an admin users. The standard user is able to view the item help whereas the admin user can view and edit the help. This was achieved with the following steps:

1. Create an Optional label Template called 'Optional Label with Editable Help'.

<label for="#CURRENT_ITEM_NAME#"><a class="t13OptionalLabelwithHelp" href="javascript:popUp2('f?p=&APP_ID.:506:&SESSION.:::506:P506_ITEM_ID:#CURRENT_ITEM_NAME#',630,600)" tabindex="999">

2. Create an Required label Template called 'Required Label with Editable Help.

<label for="#CURRENT_ITEM_NAME#"><a class="t13RequiredLabelwithHelp" href="javascript:popUp2('f?p=&APP_ID.:506:&SESSION.:::506:P506_ITEM_ID:#CURRENT_ITEM_NAME#',630,600)" tabindex="999"><img src="#IMAGE_PREFIX#requiredicon_status2.gif" alt="" />

These label templates can be used for any item help that you wish to allow admin users to edit. If you want all item help to be editable then overwrite the existing templates with the above.

3. Create a Table in your target Schema to store the help information.

"ITEM_ID" NUMBER PK
"ITEM_NAME" VARCHAR2(60)
"PAGE_ID” NUMBER
"HELP" VARCHAR2(4000)


4. Create a help page in your application with a 'popup' template (e.g. 506).

5. Create an Insert/Update form Region based on the Help table. Set the help item to be of type HTML. Create an item :P506_EDlT Hidden and Protected and set the Form Region to conditionally display when item:P506_EDIT=' Y'.

6. Add another HTML region with an item of type Display Only to conditionally display when :P506_EDIT is null source of type SQL

SELECT help FROM help WHERE item =:P506_ITEM_ID

7. Add an edit button to the HTML region with a branch to change the :P506_EDit=' Y'.

8. Migration Script

INSERT INTO help
(item_id, item_name, page_id, help)
(SELECT
item_id, item_name, page_id, item_help_text
FROM
apex_application_page_items
WHERE application_id = 55349
AND item_label_template LIKE '%Editable%')

Comments

Andy said…
Nice one Shunt. Works a treat.

Any reason to use #CURRENT_ITEM_ID# instead of #CURRENT_ITEM_NAME#?