Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.8K Databases
- 221.5K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.8K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 27 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 393 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
How to add toggle button in Interactive Report

Hi Expert,
I have a requirement where i need to add a toggle button in interactive report and also once user toggle, the report should get refresh .
How we can achieve this functionality in oracle apex.
Apex version : 20.2.0.00.20
Regards,
Pritam
Answers
-
I have a requirement where i need to add a toggle button in interactive report and also once user toggle, the report should get refresh .
What do you mean by "toggle button"?
Where is this to appear in the interactive report?
Why should the report be refreshed when the switch is toggled? What action/process is really involved?
-
Hi,
we need toggle in interactive report because we have a one column called flag where we have value either 'Y' or 'N'.
So when user toggle it to 'ON' that moment the report should refresh and update the table with flag 'Y'.
Similarly when when toggle it to 'OFF' the report should refresh and update the table with flag 'N'.
I hope i explained the requirement properly.
Regards,
Pritam
-
It doesn't make much sense. If you have a Y/N value column, every record in the table has a Y/N value.
So, what is "update the table"? Just that one record in the table? You don't need to refresh the whole report for that, as it only changes the one record that you just changed.
Furthermore, why use Interactive Report for this requirement? Create an Interactive Grid with a Switch type column.
-
I might have an idea what he's driving at?
So when user toggle it to 'ON' that moment the report should refresh and update the table with flag 'Y'.
Similarly when when toggle it to 'OFF' the report should refresh and update the table with flag 'N'.
I'm imagining a vacation request approval system, where the IR shows all the staff requests for vacation time. Steps:
- Above the IR is a region with Pritam's toggle button, which has Y/N values.
- On the IR, the Approved column is NULL.
- The manager filters to show the requests they want to approve.
- Then they click the Toggle button to Y
- The filtered records get updated to Y
- The IR refreshes, showing that the Approved column is now Y.
JMHO, but I would use traditional buttons, not a toggle, since the toggle usually has a default value.
In this scenario, I'd envision would call a Dynamic Action that would:
- Run a Execute PL/SQL Code script that passes the Apex collection with the primary keys of the filtered IR rows and the Button value (Y/N) to a compiled stored procedure. That procedure uses the primary keys to update the underlying table to the Button value.
- Refresh the IR region.
You can Google for the method for getting the primary keys for the IR.
Pritam, if I guessed right, please mark this answer Correct.
-
I might have an idea what he's driving at?
That's a pretty wilde guess indeed 😃
-
Hi Stew,
Your understanding is correct.I will follow the approach that you have mentioned and update you.
Regards,
Pritam
-
Does that make me a "wild and crazy guy"? 🤪
It seems that I guess right, which confirms the old saying that "even a blind pig can find an acorn once in a while"! 😁