Creating help functionality with apex_application.help

To support a user-friendly interface, applications can be enhanced with a help-functionality. In APEX, you can easily build a context-sensitive help. You can place a help link in the navigation bar so that it is available on every page in the application.

Getting ready

Make sure you have an existing application with some pages where you can show some help.

How to do it...

First, let's create the help page:

  1. In the application builder, click the Create page button.
  2. Select Blank page.
  3. Enter a page number and an alias. Click Next.
  4. Enter a name for the help page. Click Next.
  5. Select No tabs and click Next.
  6. Click Finish.

    The page has now been created. Click the edit page icon to continue.

  7. In the regions section, click the Add icon.
  8. Select PL/SQL Dynamic content.
  9. Enter a title. Click Next.
  10. In the PL/SQL source text area, enter the following code:
    APEX_APPLICATION.HELP(
    p_flow_id => :APP_ID,
    p_flow_step_id => :REQUEST,
    p_before_region_html => '<p><br/><table bgcolor="#33BED8" width="100%"><tr><td><b>',
    p_after_prompt_html => '</b></p>&nbsp;&nbsp;'),
    

    [1346_07_06.txt]

    • This piece of code calls the APEX built-in APEX_APPLICATION.HELP, which shows the help. This help is customizable by using parameters. You can find an overview of the parameters at the end of this recipe. In the previous example, you can see that the parameter P_BEFORE_REGION_HTML and P_AFTER_PROMPT_HTML are used to display a help with a header with a background color #33BED8 (blue).

      You can also see the parameters P_FLOW_ID and P_FLOW_STEP_ID. Those are the two parameters to indicate the application and the page where the call comes from. To pass these parameters, :APP_ID and :REQUEST are used.

  11. Click the Create region button.

    The region has now been created and the help page is ready now. Next, we will enter some help text and create a link in the navigation bar.

  12. Go to a page where you want to enter the help text.
  13. In the page section, click the link behind the page name.
    How to do it...
  14. Click on the Show all tab.
  15. Go to the help section and enter some help text in the text area.
  16. Click the Apply changes button.
  17. If you have items on the page click on the item and go to the help text section.
  18. Enter some help text in the text area.
  19. Click the Apply changes button.
  20. Repeat these steps for the other items on the page.
  21. Go to shared components, Navigation Bar Entries (navigation section in the upper-right corner).
    How to do it...
  22. Click the Create button.
  23. Select From scratch and click Next.
  24. Select Navigation to URL and click Next.
  25. Enter help in the entry label text field and click Next.
  26. In the target list box, select URL.
  27. In the URL target text area, enter the following:
    javascript:popupURL('f?p=&APP_ID.:<PAGE>:&SESSION.:&APP_PAGE_ID.'),
    

    [1346_07_07.txt]

    • Where <PAGE> is the page number of the help page you just created.
  28. Click Next.
  29. Click the Create button.

The help functionality is ready now. To offer a complete help, check that help text is entered at every page and every item.

When you run a page you will see that the navigation bar contains a help link. Clicking on this link will show you a pop-up window with the help text.

How to do it...

How it works...

In this example, we make use of the APEX_APPLICATION.HELP built-in. The built-in collects the help information and shows it in a pop-up window. The call to APEX_APPLICATION.HELP comes from within a PL/SQL dynamic region. It gets the information from the help link. The help link in the navigation bar contains the URL to the help page and contains the session ID and the page ID so that these two variables can be passed to the call to APEX_APPLICATION.HELP.

You can also use a region of type Help to get the same result. However, with the built-in, you can customize with colors and other formatting options.

There's more...

The APEX_APPLICATION.HELP function has the following parameters:

Parameter

Meaning

P_REQUEST

P_FLOW_ID

Not used.

The ID of the application.

P_FLOW_STEP_ID

The ID of the page.

P_SHOW_ITEM_HELP

Show item help. Default Yes.

P_SHOW_REGIONS

Show region headers. Default Yes.

P_BEFORE_PAGE_HTML

Use HTML code between page level help text and item level help text.

P_AFTER_PAGE_HTML

Use HTML code at the end of the page.

P_BEFORE_REGION_HTML

Use HTML code before every region section. Ignored if P_SHOW_REGIONS is No.

P_AFTER_REGION_HTML

Use HTML code after every region section. Ignored if P_SHOW_REGIONS is No.

P_BEFORE_PROMPT_HTML

Use HTML code before every item label for item level help. Ignored if P_SHOW_ITEM_HELP is No.

P_AFTER_PROMPT_HTML

Use HTML code after every item label for item level help. Ignored if P_SHOW_ITEM_HELP is No.

P_BEFORE_ITEM_HTML

Use HTML code before every item help text for item level help. Ignored if P_SHOW_ITEM_HELP is No.

P_AFTER_ITEM_HTML

Use HTML code after every item help text for item level help. Ignored if P_SHOW_ITEM_HELP is No.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.237.24