Monday, March 13, 2017

Fixing Skillbuilders Super LOV (v3) in APEX 5.1

We have already migrated some of the existing applications to a new version of Oracle Application Express - 5.1. After few weeks in production I can just say...do it :). But when doing an upgrade there is always a possibility that you will hit some issues. For me one of the issue was Skillbuilders Super LOV (v3), and it looks like I'm not alone (https://community.oracle.com/thread/4010580)

So what is the issue? 

When you select a value (Super LOV item) and try to save a form then the value is not submitted. Now if you are lucky, then your item is mandatory and you will see the error - end users will tell you right away that something is not working. If your item is not mandatory then you might see this error much later, with complaints that some data is not saved correctly.

Value is selected
After submit, value is cleared and we see an error

After a bit of research I have found a quick fix, that you can use, until the plugin is fixed by original authors. What has to be done is just one small change in plugin's render function. Search in the source for line with disabled="disabled" (should be somewhere in line 157, if you haven't done some changes)

THEN 'disabled="disabled" onfocus="this.blur();"'

and change it to:

THEN 'readonly="readonly" onfocus="this.blur();"'

Notice the change is line 157 and 158

It looks like that something has changed from version 5.0 to 5.1. If you have an item with a property disabled="disabled", then after submitting the page you will not see value for this item.

To test this, I have created an After Submit Process with the code:

apex_debug.error('Value of P2_LOV : %s', :P2_LOV);

I have tried this on version 5.0.4 and 5.1 and after checking the debug there is a clear difference:

Debug in APEX 5.0

Debug in APEX 5.1


Aljaz

Saturday, March 4, 2017

Using APIs to set Application and Build Status in Oracle Application Express 5.1

In Oracle Application Express it is possible to specify application-level attributes: Build Status and Application Status. With Build Status we can prevent that an application is being modified by other developers. With Application Status we can specify whether an application is available or unavailable for use.

Topic of this blog post is not to talk in detail about this two attributes (if you want to know more, then check the official documentation), but to mention how we can use APIs to manage this attributes in Oracle Application Express 5.1

Build Status

For setting build status we can use the following procedure:

  apex_util.set_app_build_status( 
     p_application_id IN NUMBER,
     p_build_status IN VARCHAR2);

For p_build_status we can specify RUN_ONLY  and RUN_AND_BUILD.  More details about this API can be found here.

Application Status

For changing the status of the application, we can use the following procedure:

  apex_util.set_application_status(
        p_application_id IN NUMBER,
        p_application_status IN VARCHAR2,
        p_unavailable_value IN VARCHAR2,
        p_restricted_user_list IN VARCHAR2); 

I don't want to do a copy/paste from the official documentation, so please check this link for parameters description and examples. 

Aljaz

Wednesday, February 8, 2017

New Look & Feel for Radio Group in Oracle Application Express 5.1

With Oracle Application Express version 5.1 we are getting lots of new features. Among most notable or exposed are for sure Interactive Grids, JET Charts and Live Template Options. But we can also find some smaller (and really nice) enhancements. One of this is new look and feel of Radio Group item. We can spot this for example when we use Create New Page wizard in Page Designer:



So what do we need to do, if we want to have this look and feel in our applications. Just adding combo box item to our page is not enough, it will have the same effect as in version 5.0. It will look like this :


Basically we need to change three things.


  • Number of Columns: should match number of elements in group or you can also set it to some bigger value (for example 100)
  • Display Null Value: NO 

  • Template Option -> Region Group Display: Display as Pill Button


After this three small changes we now have new look and feel for our radio group:


For me personally the same page looks much nicer now. And if you want, you can also try all the other template options (do it with Live Template Options, so that you see the effect on the fly) for radio group item and tweak the look and feel even further.

Aljaz