EdHayes3
EdHayes3

Reputation: 1954

Conditionally display a link within an interactive data grid in Oracle APEX

I want to display a link in a data grid, only when a certain condition is met for that record. I also want that link to be dynamic, based on the data in the data grid. Lastly, the data grid is linked to a header record displayed above the data grid region.

Upvotes: 0

Views: 2095

Answers (1)

EdHayes3
EdHayes3

Reputation: 1954

  1. Create a hidden field that will be used for the Link Text. Column Name = HIDDEN_LINK_TEXT. Type = Hidden. This field will have a source type of SQL Expression. Q in this example query represents the data grid's source select statement. Parenthesis are required in the SQL Expression text box for the hidden field.

(SELECT '[Static link text]' FROM TABLE B WHERE B.RECORD_ID = Q.RECORD_ID AND B.FIELD_1 = Q.FIELD_1 AND B.FIELD_2 = Q.FIELD_2)

  1. Create a displayed field for the link. Column Name = DISPLAYED_LINK Type = Link.

  2. Link Text should reference the hidden field we created in step 1. Link Text = &"HIDDEN_LINK_TEXT". Include the ampersand and double quotes.

  3. Set the link target to what your target page. Include any variables or "Set Items" which you want to set when linking to the page.

Upvotes: 1

Related Questions