Ewaver
Ewaver

Reputation: 1191

Oracle APEX Text Page Item as non-editable hyperlink field from a SQL Query

My colleagues and I have spent too many hours trying to do what we think should be fairly simple to do but have had no success. We have a table that includes a column of web addresses. On our form page we are creating items in a grid where certain items needs to be non-editable actionable hyperlink fields for the users to click and have the link open in another page (i.e. Target = Blank). We have tried these solutions from this blog with no success:

https://community.oracle.com/thread/618722?tstart=0

Here are our requirements specifically:

  1. We have a text item: :P2_link1 that pulls the web address in via SQL query in the 'Source>Source Used = Only when current value of item is null and Source type = SQL Query such as :

    select ref_link from table1 where step = 1.1;

  2. On our Form Page, the item needs to te a non-editable item (i.e. they cannot edit the web address that is pulled in via the SQL query). But the link needs to be actionable such that a new tab or window opens to the page referenced in the SQL query.

We really appreciate any help you can provide,

Thanks,

Upvotes: 1

Views: 13390

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132570

Use a Display Only item not a text item.

You need to construct the HTML for the link in the item source for example:

select '<a href="' || ref_link || '">' || ref_link || '</a>' 
from table1 
where step = 1.1;

By default this will display escaped like this:

<a href="http://bbc.co.uk">http://bbc.co.uk</a>

Edit the item, go to Security and set Escape special characters to No.

Now you should see a working link.

Upvotes: 4

Related Questions