Skip to main content

APEX and jQuery UI integration

We can import every javascript library (including jQuery) to Oracle APEX using standard import file process available from application level (Home>Application Builder>Application>Shared Components>Static Files) and then reference it in page header using #APP_IMAGES# or #WORKSPACE_IMAGES# as file source.

However files imported this way won’t be cached by browser (they are in database, not in server’s file system) and using this technique it’s hard to import packages containing several files referencing  to each other (like jQuery UI).

So if it’s possible you should upload jQuery and jQuery UI files directly on APEX server. To do this, find APEX folder and "images" catalogue inside. In "images" create subfolder "jQuery" and copy there jQuery and jQuery UI files.


FILES FROM SERVER 

In "images" folder you should find imagelist.xml file. Edit it and add all dictionaries and all files you’ve just copied. Save the file, run SQL*Plus and execute script:

SQL> @apxldimg.sql PATH

where PATH is your APEX folder path. After several minutes all files will be available.

To use jQuery you must reference to imported files in HTML header (on single page or in page template) using:

<link rel="stylesheet"  type="text/css" href="#IMAGE_PREFIX#jQuery/css/ui-lightness/jquery-ui-1.8rc2.custom.css" />
<script type="text/javascript" src="#IMAGE_PREFIX#jQuery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="#IMAGE_PREFIX#jQuery/js/jquery-ui-1.8rc2.custom.min.js"></script>


FILES FROM EXTERNAL SOURCE

If you don't want or simply can't import jQuery libraries and CSS in this way you can load them from external source (it's good idea for OTN applications). Just put this text in HTML header:

<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
   google.load('jquery', '1.4.2');
   google.load('jqueryui', '1.8.1');
</script>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/redmond/jquery-ui.css" />


TEST Jquery Work Perfectly in APEX

To check if everything works fine, create new datepicker item on your page. In page HTML header put following code:

<script type=”text/javascript”>
$(document).ready(function () {
     $(".datepicker > input[id]").datepicker( { dateFormat: 'yy-mm-dd' });
});
</script>

After page refresh, when you click inside datepicker field, calendar region should appear.

Food for IT Professional

--- Cheers !!!

Comments

Popular posts from this blog

Oracle forms 11g default configuration file formsweb.cfg

#formsweb.cfg defines parameter values used by the FormsServlet # formsweb.cfg defines parameter values used by the FormsServlet (frmservlet) # This section defines the Default settings. Any of them may be overridden in the # following Named Configuration sections. If they are not overridden, then the # values here will be used. # The default settings comprise two types of parameters: System parameters, # which cannot be overridden in the URL, and User Parameters, which can. # Parameters which are not marked as System parameters are User parameters. # SYSTEM PARAMETERS

No free space to rebalance ASM disk group

   To day we found below warning message from Exadata system: Warning: Software Alert 92_1 Event Time 2025-01-23T16:19:57+06:00 Description Insufficient free space to rebalance the ASM disk group: RECOC1 Affected Server Name ******* Server Model Oracle Corporation ORACLE SERVER X9-2 Chassis Serial Number 2217XCD00X Release Version 24.1.5.0.0.241016 RPM Version 24.1.5.0.0.241016 Recommended Action Please refer to MOS Doc 1551288.1                                                                                                I am search  Chatgpt and found below solutions. Rebalancing an ASM (Automatic Storage Management) disk group in Oracle is a process where the disk group redistributes data...

Error Initializing Opera: module 15

Solutions: You should manually remove directories name as "Opera" from  %PROGRAMFILES% ,%APPDATA% and %USERPROFILE% . RUN(Windows Logo Key + R)-> Enter '%PROGRAMFILES%' -> Then press OK Button. Open a new window, There find Opera folder and delete it. Same as %APPDATA%  and %USERPROFILE%. What programming languages should I learn to make a website How do i transfer music from my mac to my iPhone using the iTunes HOW TO FIX ICE CREAM SANDWICH UPDATE ERRORS !!! Fix an app that isn't working properly in Nexus how to reset Google nexus 7 Screen flicker problem in iPhone 5 DATE AND TIME PROBLEM IN IPHONE5 Another way: IF it's install in C drive you can delete opera folder from below location : c: \ Program Files \ Opera \ c: \ Documents and Settings \ Username \ Application Data \ Opera \ c: \ Documents and Settings \ Username \ Local Settings \ Application Data \ Opera \ Any you getting any problem give a comments. You can also see...