skip to Main Content

I’m working with APEX ORACLE ver 23.1. My problem is to conditionally display or hide fa-warning in inline help text of one page item (P1_item1). The condition is based on another page item:

  • display if P1_item2 <> ''
  • hide if P1_item2 = ''

And the help text will be the following

if P1_item2 <> ''
<span class="fa fa-warning" aria-hidden="true"></span> &P1_item2.

If anyone of you have an idea about how to solve this?

Thanks in advance.

2

Answers


  1. As stated in the help attribute of the inline help text, the type should be a HTML statement: HTML

    So to have conditional values, you need to create another page item such as P1_INLINE_HELP_TEXT and then you can reference this page item as &P1_INLINE_HELP_TEXT.

    The new page item should contain the HTML text computed/calculated by a dynamic action or a process either on page load or on a change of value etc.

    The source of the page item P1_INLINE_HELP_TEXT should look like something like this:

    case when ( :P1_ITEM2 != 30  ) then '<span class="fa fa-warning" aria-hidden="true"></span>' else null end
    

    EDIT

    As you mentioned the HTML calculated displayed as text and not rendered, use a JQuery snippet like this:

    $('#P1_ITEM_inline_help').html($('#P1_ITEM_inline_help').text());
    

    This will get the text of the span (i.e " < span class="fa fa-warning" > </ span>") and set it as HTML.

    Login or Signup to reply.
  2. In Oracle '' is identical to NULL.

    Oracle uses trinary logic where comparisons can evaluate to TRUE, FALSE or NULL and if you use Anything = NULL or Anything <> NULL then the result is always NULL and never TRUE or FALSE.

    If you want to test whether a value is NULL (or '') or is not NULL (or not '') then use:

    P1_item2 IS NULL
    

    or

    P1_item2 IS NOT NULL
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search