SkillBuilders / super-lov

Popup LOVs with a web 2.0 twist
MIT License
1 stars 0 forks source link

SkillBuilders Super LOV

An Item Plug-in for Oracle Application Express (APEX)

Overview

The built-in Popup LOV item in APEX can be a powerful tool when the number of possible selections is too high for other item types that use LOVs, such as a select list. However, people often wish to display more information when making a selection than this item type allows. In the past, developers worked around this issue by either concatenating values in the display column or by creating a custom solution.

Custom solutions provided the ultimate flexibility but required a lot of knowledge and were not always easily transferable to other items, pages, or applications. The SkillBuilders Super LOV plug-in is designed to make these issues a thing of the past while providing a rich, web 2.0 experience.

Features at a Glance

Installation and Configuration

Installation

Standard

With this installation package there is a plug-in installation file named:

Navigate to “Shared Components > Plug-ins” and click Import > . From there you can follow the menu to upload and install the plug-in using the file above. After the plug-in has been installed successfully you will be redirected to the plug-in edit screen.

Optional Performance Upgrades

After installing the plug-in you can make it more performant by either using packaged code, files on the file server, or both.

If you wish to test the package based code, simply compile the package spec and body and add the package name and a period to the beginning of each of the function names in the Callbacks region. At that point you could even safely remove the contents of the PL/SQL Code in the Source region.

If you wish to test the files on the apps server, simply copy the files in the "server" directory to a directory on the apps server and change the File Prefix attribute of the plug-in to point to that directory.

Example: If you copy the contents of "server" to /images/plugins/apex_super_lov_3_0, Then set the "File Prefix" attribute of the plug-in to #IMAGE_PREFIX#plugins/apex_super_lov_3_0/

Configuration

Once installed, this plug-in can be used as a native APEX component. When creating a new item, select the “Plug-ins” option and then choose the plug-in on the next page.

Here’s a sample query that could be used for the LOV. Notice how column aliases are used to generate formatted column headings.

SELECT empno AS "Emp No.",
  ename AS "Employee",
  job AS "Job",
  sal AS "Salary"
FROM emp

See Configuration Settings for details on how the application and component settings affect the plug-in.

Configuration Settings

Application Settings

Application settings are used to configure all instances of a plug-in within an application. These settings are accessed by editing the plug-in within the Shared Components. This plug-in has the following application settings:

Setting Description
Search Type Control how search strings are used to filter the LOV result set.
Loading Image Type Choose between a default or custom loading image. The loading image is displayed when the LOV is opened, before the result set appears. There are a number of default loading images that can be used (see Loading Image next) but you can use your own as well.
Loading Image Specify which loading image you would like to use. Based on the Loading Image Type selection, you will either choose from a number of default images or you will specify the path/name to a custom image.
Effects Speed Specify the speed at which the modal dialog should perform certain effects such as sizing, resizing, and fading. Selecting “instant” will essentially disable any effects.
Use Clear Confirm Enable or disable the Clear Confirm feature. Clear Confirm requires the user to click the clear button twice to clear the selected value. This is done to help prevent accidental clearings that would require the LOV to be reopened.
When No Data Found Message Specify what message should be displayed to users when the LOV query fails to retrieve any results.

Component Settings

Component settings are used to configure an individual instance of a plug-in within an application. These settings are accessed by editing the component as you would a native APEX component. This plug-in has the following component settings:

Setting Description
Use Value Validation Use this setting to enable or disable the Value Validation feature. Value Validation will re-check the submitted value against the LOV. If the value is not found then the validation will fail and the user will see a validation error message.
Dialog Title Use this setting to explicitly set the title of the dialog. If no value is supplied then the item’s label will be used.
Item Display & Return Columns Use this setting to specify which column should be used for the item’s display value and which column should be used for the item’s return value. The value should be a comma separated pair of numbers where the numbers refer to the column in the LOV query. The first number should be the display column and the second number should be the return column. The display column will be used as the default search column.
Searchable Columns Use this setting to specify which columns should be displayed in the select list of columns that allows users to filter the LOV result set. The value should be a comma separated list of numbers where the numbers refer to columns in the LOV query. If no value is supplied then all columns will be searchable. If a value is supplied then only those columns will be searchable. The display column (defined via Item Display & Return Columns) will always be searchable and will be the default search column.
Hidden Columns Use this setting to specify which columns should be hidden when the LOV is displayed. The value should be a comma separated list of numbers where the numbers refer to columns in the LOV query. If no value is supplied then all columns will be visible. The display column (defined via Item Display & Return Columns) will always be visible.
Map from Columns Use this setting to specify which columns should be used to map values to other items (see Map To Items). The value should be a comma separated list of numbers where the numbers refer to columns in the LOV query. Both visible and hidden columns can be used when mapping to other items.
Map to Items Use this setting to specify which items should be used when mapping values from columns (see Map From Columns). The value should be a comma separated list of item names. The order of the items in Map To Items should match the order of the columns in Map To Columns.
Enterable Use this setting to make the item "enterable". If enterable, users will be able to type in the actual textbox. The display column (defined via Item Display & Return Columns) will be the default search column against which values entered will be validated. If one match is found then the display and return values will be set accordingly. If no match is found or multiple matches are found the modal dialog will open so that the user can make a selection.
Max Rows Per Page Use this setting to specify the maximum number of records that should be displayed at one time.
Show Null Values As Use this setting to specify how null values should be displayed in the result set.

Methods

The disableItem and enableItem methods can be used to programmatically disable or enable the item. Example(s):

  $('#P1_ITEM_NAME').apex_super_lov('enable');
  $('#P1_ITEM_NAME').apex_super_lov('disable');

The hideItem and showItem methods can be used to programmatically hide or display the item and its label. Example(s):

  $('#P1_ITEM_NAME').apex_super_lov('hide');
  $('#P1_ITEM_NAME').apex_super_lov('show');

The hideRow and showRow methods can be used to programmatically hide or display the item, its label, as well as any other elements that exist in the same table row. Example(s):

  $('#P1_ITEM_NAME').apex_super_lov('hideRow');
  $('#P1_ITEM_NAME').apex_super_lov('showRow');

The getValuesByReturn and setValuesByReturn methods can be used to programmatically fetch return values and set the item using the return values. getValuesByReturn will return a JSON object with the results from the fetch. setValuesByReturn goes a step further using the return values to set the display and return values for the item. Example(s):

  $('#P1_ITEM_NAME').apex_super_lov('getValuesByReturn', '101');
  $('#P1_ITEM_NAME').apex_super_lov('setValuesByReturn', '999');

About

About SkillBuilders

SkillBuilders has been providing software solutions, database administration, application development and training, since 1995. Our niche is Oracle Database, Unix and Cloud Platform Administration (Amazon AWS). SkillBuilders is both an Oracle and Amazon AWS Partner.

Version History

Feature Requests

If you would like to see additional functionality added to the plug-in, or if you have found a bug, please let us know by posting a request through the link https://github.com/SkillBuilders/super-lov/issues

License

The SkillBuilders Super LOV plug-in is currently available for use in all personal or commercial projects under both MIT and GPL licenses. This means that you can choose the license that best suits your project and use it accordingly. Both licenses have been included with this software.

Legal Disclaimer

The program(s) and/or file(s) are supplied as is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of these program(s) and/or file(s).