Hi
My non-editable interactive grid has a column link which is displayed as a button to cancel a transaction. I implemented it as per the blog (https://www.foxinfotech.in/2019/10/create-delete-row-button-for-interactive-report-in-oracle-apex.html).
Now I want to show cancel button only for some rows? I also have update button for eligible rows. How can show both cancel and update buttons in single column as actions?
Thanks
Kishore
I found a solution using style attribute to display the icon as inline/none. I added a new column in SQL.
CASE WHEN cancel_icon = ‘Y’ THEN ‘inline’ ELSE ‘none’ END cancel_icon_disp,
Then added below to the Link Attribute.
style=”display:&CANCEL_ICON_DISP.” id=”&TRANSACTION_ID.” title=”Cancel” class=”cancel t-Button t-Button–noLabel t-Button–icon t-Button–small t-Button–danger t-Button–slim”
Logic is based on cancel_icon column rather status. I will have additional logic in the pl/sql process to check if the transaction is eligible for cancellation since css can be manipulated in the browser to invoke cancel button.
This is the right approach.
To do this, now I am suggesting a different logic. Follow these steps:
In your interactive grid SQL query, take two more columns as below:
Make the LINKACTION column hidden.
Make the LINKTEXT column as a Link type.
Then click on the link target property and changed the target type to URL and the URL as &LINKTEXT. and Link text as &LINKTEXT. Below is the image:
Create two hidden page items. For example, I created as:
P39_EMPID
P39_ACTION
Set the value protected off for these two hidden items.
For the page, in the Function and Global Variable declare section create the following JavaScript function:
Then click on the Process tab, and create an Ajax Callback process ajx_action as following:
It is done. Save the changes and run the page to test.
Please let me know if any issues.
Thanks Vinish. I may have confused you by adding second question to original question. In the above example, I want to display Delete link only when Manager_ID = 100. Otherwise no link is shown.
Second question was instead of showing Delete and Update links in two separate columns conditionally when Manager_ID = 100, I thought I will show both links in single column separate by space.
Thanks
Ok, for the first question, you can modify the decode statement as follows:
If the manager id is not equal to 100, it will create the link as #, and on click, it will not work.
For the second question, when you will implement the above complete example, it will not create the Delete and Update links in two different columns; it will create in one single column.
But now you want to display two links in a single column; please check this link.
Thanks. I don’t want to display link text/icon when my condition don’t meet instead of showing link with # as target.
Below is the screenshot. Here I want to show Cancel when status is Pending Approval. For other statuses, cancel button is hidden.