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
As stated in the help attribute of the inline help text, the type should be a HTML statement:![HTML](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201578%20250'%3E%3C/svg%3E)
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:EDIT
As you mentioned the HTML calculated displayed as text and not rendered, use a JQuery snippet like this:
This will get the text of the span (i.e " < span class="fa fa-warning" > </ span>") and set it as HTML.
In Oracle
''
is identical toNULL
.Oracle uses trinary logic where comparisons can evaluate to
TRUE
,FALSE
orNULL
and if you useAnything = NULL
orAnything <> NULL
then the result is alwaysNULL
and neverTRUE
orFALSE
.If you want to test whether a value is
NULL
(or''
) or is notNULL
(or not''
) then use:or