Add an Icon next to an Item to Open a Modal (Or execute any other Javascript code)
Barry's IT Development Blog
by
2M ago
Requirement You want to add an icon next to an item to call an inline dialogue. Example if you want to create a custom select list, or advanced help, or (with an adaption) call another page. Solution In the post text field attribute of your item put this: <a href="javascript:apex.theme.openRegion('ICONS');"><span ></span><span >"LIST_IMAGE_LOV_TITLE"</span></a> You can replace the code after javascript to execute a script or call another page. In my case I created a region of template type "Inline Dialogue" and with a static ID of ICONS. Ackno ..read more
Visit website
How to find which item has been changed in APEX
Barry's IT Development Blog
by
4M ago
Requirement You need to know which items have changed. This could manifest itself with a "Leave Site..?" message when you didn't think anything had changed. TIP: If you've opened a modal, be aware that the item changed could be in the calling page, which confuses you into looking at the wrong page. Without knowing this you can spend ages looking for something that has changed on the wrong page. Solution Open the web console and paste the following: Object.keys(apex.items).filter((key) => apex.items[key].isChanged()); The console will then tell you which items have changed in sessio ..read more
Visit website
Ensuring the right time in Apex
Barry's IT Development Blog
by
9M ago
Problem Time is wrong in Apex. Example, using apex.oracle.com, whenever sysdate is referenced, the time is an hour out. Solution (1) Ensure that the timezone is correct in Apex Edit application attributes Set this on (2) Ensure that you select in the right way. Above report SQL shows correct and incorrect way of getting the time: select to_char(sysdate,'DD-MON-YYYY HH24:MI') "sysdate", to_char(cURRENT_TIMESTAMP,'DD-MON-YYYY HH24:MI') "cURRENT_TIMESTAMP" from dual Current_timestamp is correct. Sysdate is not. Acknowledgement Error on setting Automatic Timezone in Oracle ..read more
Visit website
Fetching and Posting JSON using Apex
Barry's IT Development Blog
by
9M ago
Requirement Hypothetical method for storing a JSON CLOB in an Apex app region and collection You want to store information within an app without migrating and tables or data. In this case a list of quality control QA Yes/no attributes for the app. Benefit is that each app has this data built into it and will thus be migrated with it automatically. Note: Writing to a region was chosen because it's a CLOB object. There is no API for this, so use at your own risk. In my case I needed to use the power of an apps-owned package (authid definer, granted to my apex user. Solution JSON CLOB is stored ..read more
Visit website
Oracle SQL: Fetch Monday to Friday dates based on current date or inputted date
Barry's IT Development Blog
by
1y ago
 Requirement: Fetch Monday to Friday dates based on current date or inputted date. Solution select to_char(dow,'DAY')||' '||to_char(dow,'DD-MON-YYYY') display_date,dow date_returned from  (select next_day(to_char(sysdate,'DD-MON-YYYY'),'MONDAY')+ (rownum-1) - 7 DOW from dual connect by level <= 5); Replace "sysdate" with any date paremeter.   Acknowledgement Displaying week days for current week - Ask TOM (oracle.com)   ..read more
Visit website
Hiding the close button on a modal dialog page
Barry's IT Development Blog
by
1y ago
 Requirement You want to take away the close button of the modal window. A good reason could be because you want to force the user to press your own close button and so force something to happen. Solution In the modal dialog page, paste this script in the "Execute when Page Loads" section. var button = parent.$('.ui-dialog-titlebar-close'); //get the button button.hide(); //hide the button Result Gone! Acknowledgement Oracle APEX hide the x on the modal dialog - Stack Overflow   ..read more
Visit website
Oracle Apex: Responding (success/failure) to a call to Apex.server.process
Barry's IT Development Blog
by
1y ago
Requirement React to a Javascript call to apex.server.process In my example, at the end I'll call an inline dialogue after processing. Solution Create a Javascript dynamic action. In my example it is initiated with a button. Javascript Code. var $wP; var displayError = function(error) {     console.error("Promise is rejected:", error); }; var call_block1 = function() {     $wP = apex.widget.waitPopup();     return "End of Block 1"; }; var call_block2 = async function() {     return apex.server.process( "MY_CALLBACK", {pageItems: "#P_TEXT_IN"}, {dat ..read more
Visit website
Oracle Apex: Manipulating a large text CKEDITOR static REGION via an interactive report, CLOBs and database processes.
Barry's IT Development Blog
by
2y ago
 Requirement Because we needed to use an older version of CKEDITOR, it was necessary to load the text editor as a region rather than an item. Similar to what has been explained here: https://content.dsp.co.uk/apex/implementing-ckeditor-5-in-apex-19 But now the requirement was to inject text into the editor on demand. That injected text itself was on the database. The text would be selected from a report. The size of the region could easily be over 32k meaning that workarounds were required to overcome current (Apex 21 and below) limitations. I tried several plugins but found them unr ..read more
Visit website
Oracle Apex - Passing values to a modal
Barry's IT Development Blog
by
2y ago
 Problem You have a button which calls a different modal page. Even though you specify the target page item and source value, the modal does not receive the parameter. Solution Create a hidden item to store a URL. Mine is called P5_ATTACHMENT_URL The parameter that I want to pass is P5_MESSAGE_ID. Create a dynamic action on change of the value that you want to pass. (If you have more than one value you will need to repeat these steps) You want to set the value with this code, don't forget NOT to escape special characters otherwise the link will not make sense. Here is my code ..read more
Visit website
Oracle Apex - Populating a rich text editor item from the DB
Barry's IT Development Blog
by
2y ago
 Requirement You want to populate a rich text item from a value (Clob) stored in the DB. Settings defaults and source doesn't do anything, this worked for me. Solution Assume my item is  Add this application process. Mine is called FETCH_SIGNATURE and its processing point is Ajax Callback. Replace the SQL select at the beginning with your table/column/parameter. DECLARE   l_clob        CLOB;   l_file        BLOB;   l_dest_offset PLS_INTEGER := 1;   l_src_offset  PLS_INTEGER := 1;   l_lang_ctx    PLS_INTEG ..read more
Visit website

Follow Barry's IT Development Blog on FeedSpot

Continue with Google
Continue with Apple
OR