Custom Attributes
These attributes are available in page designer for a dynamic action implementing the plug-in.
Attribute | Dependent on | Type | Description |
---|---|---|---|
Table Name | Not Applicable | Text | The table name which stores the BLOB content to be downloaded. The table has to be accessible from the current parsing schema. |
BLOB Column | Not Applicable | Text | BLOB column from the table which stores the BLOB content. If the specified column type is not a BLOB, an error is raised when the page loads the plug-in. |
Primary Key Column | Not Applicable | Text | The primary key column of the table which stores the BLOB content to be downloaded. |
IG Column Containing BLOB ID | Not Applicable | Text | The column name in the interactive grid that stores BLOB primary key. This column doesn't have to be visible but must be accessible trough the interactive grid JavaScript API. |
Mime Type Column | Not Applicable | Text | The mime type column from the table which stores the BLOB content to be downloaded. |
File Name Column | Not Applicable | Text | The filename column from the table which stores the BLOB content to be downloaded. |
Settings | Not Applicable | Checkboxes | An attribute defines the behavior of the plug-in. Available options include: Download When Ready When checked, the plug-in initializes browser download of the file, immediately after the file is transferred from the database to the end-user's browser. When not checked, the plug-in fetches and stores the file contents and details but does not initialize the browser download. To download the file you need to define a dynamic action for the File Download - file is ready event. Context Menu When checked, the plug-in enables context-menu with predefined actions. The context-menu is invoked after a right mouse click on the triggering element. When not checked, the plug-in doesn't override the default browser action for a right mouse click on the triggering element. See help text for attribute Context Menu Options to learn more about customizing the plug-in context-menu. Change Default Action When checked, the plug-in allows overriding of the default action (left mouse button) on the triggering element. * When not checked, the plug-in uses the default action (download file) when end-user clicks (left mouse button) on the triggering element. See help text for attributes Default Action and Custom Action to learn more about changing the default action. |
Context Menu Options | Settings | JavaScript Code | This attribute allows you to customize the plug-in context menu in the context of the file to be downloaded. The valid attribute value is an anonymous function returning an array of APEX menu.Item objects. The function accepts three parameters: menu, items, and context: menu A jQuery reference to the DOM object that is used as the container for the plug-in context-menu. Use it to reference existing context-menu entries. items An array of menu.Item objects describing the APEX menu widget entry. Read the official documentation for APEX popup menu items to learn more. https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/menu.html#.Item * context A JSON object containing information about the plug-in methods, file to be downloaded, triggering element, and interactive grid. |
Default Action | Settings | Select List | This attribute changes the default action after the left mouse button click event is performed on the triggering element. Available options include: Context Menu When selected, the plug-in’s default action opens the plug-in context menu. Open In New Tab When selected, the plug-in’s default action is Open in a new tab. The file contents is embedded in an iframe. If the browser supports previewing the file (based on type) it can be previewed directly in the browser. Otherwise, the file is downloaded in a new tab. Preview When selected, the plug-in’s default action is Preview. The file contents is embedded in an inline dialog with the ability to download the file. If previewing the file is not possible then the inline dialog contains information that file can't be previewed. Custom Action When selected, the plug-in default action is defined by custom JavaScript code defined in the Custom Action attribute. |
Custom Action | Default Action | JavaScript Code | This code has access to the following dynamic action related attributes: this.triggeringElement A reference to the DOM object of the element that triggered the dynamic action. this.affectedElements A jQuery object containing all the affected elements. this.action The action object containing details such as the action name and additional attribute values. this.browserEvent The event object that triggered the event. Note: On load, equals 'load'. this.data Optional additional data that can be passed from the event handler. This code also has access to the triggering element, interactive grid, and plug-in methods. To fetch a file’s contents use exposed functions via this.data.fn.download. this.data.element jQuery reference to the triggering element. this.data.fn An object containing references to exposed plug-in functions that fetch the file using AJAX. this.data.fn.download( pCallback ) Returns Promise When the file is transferred (AJAX call ends) it executes the callback function passed as the argument. A callback function is executed with the overridden function context (this). Within the function body, you can use the this variable to reference a JSON object the same as this.data described in this inline help. Additionally, you can reference a file’s contents using this.file.content. this.data.fn.downloadandsave Returns Promise When the file is transferred (AJAX call ends) it automatically downloads the file. this.data.fn.newtab Returns Promise When the file is transferred (AJAX call ends) it automatically opens the file in a new tab. this.data.fn.preview Returns Promise When the file is transferred (AJAX call ends) it automatically opens the file preview. this.data.fn.savefile Returns Object describing the file (name, size, type, and content) This function downloads the file. The function should be used when you are certain that the file has been already transferred to the end-user’s browser. If the file is not yet available the plug-in raises an error. this.data.grid The interactiveGridView interface returned from the getViews interactiveGrid widget method. this.data.record The result of the grids widget method getContextRecord. * this.data.recordId Record id returned by the model interface using the getRecordId method. |