Friday, December 1, 2017

QuickSQL – Saves you time





One of the new features of APEX 5.1 definitely changed my way of creating DDL on Oracle databases. With the Quick SQL packaged application you only need to write minimal lines of markdown text to describe tables, triggers, audit tables and many other objects. This low code development concept can save you so much time, and it is even faster than the other tools available, which specialise in this job.

Read more...

Tuesday, July 19, 2016

Oracle Apex Multi-Select TAG


Today, I just released the first version of the plugin apex multiselect tag, an user friendy way to work with select lists. In this first version, the list is generated only by static values but I am working to include lov and SQL queries.

To work with it, simply download the .sql file in the link below and import into the path Shared Components / Plug-ins.

Demo:
Demo App

Download:
From Apex.world
From Apexplugins.com



Please, leave a comment with your feedback and suggestions

Saturday, July 9, 2016

How to use Font Awesome Icon in Placeholder

One good way to make items more self explanatory is to use icons on their placeholders like the search item below

Create a css class to allow icon to be recognized

.placeholder {
   font-family: FontAwesome, "Open Sans", Verdana, sans-serif;
}

and then set the created class to the item


Do not use the "Value Placeholder" to include the icon, if you do this, the code will be transformed into text. Search for the icon unicode at this link and then set it to the custom attributes field as the picture below.

placeholder=''


and then refresh the page.

    Oracle APEX 5.0 comes with FontAwesome version 4.2.0 on Universal Theme. If you want to upgrade for the last version to add some icons do the steps as follows

//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css

  1. In your Application go to Shared Components – Themes
  2. Click on Universal Theme – 42 to edit it
  3. Go to the Icons region
  4. Set "Custom Library File URLs" to //maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css 
  5. Set "Custom Prefix Class" to fa
  6. Click Apply Changes


Friday, July 8, 2016

Apex APEX_ERROR API

    When we create an apex process to execute some pl/sql code, we have the Success Message and Error message fields to input a message and give to the user an alert at the end of the process execution informing the success or failure.
     Usually there are many possibilities of error on a extensive pl/sql code, and one simple generic error alert is not so productive. It's more easier to show specific messages telling the user in which process point something went wrong.

The Apex API called APEX_ERROR helps a lot. When this procedure is executed, the an apex error message alert shows. We can use this on validations and process.

A simple way to use it:

begin

If :P1_ENAME is null then


APEX_ERROR.ADD_ERROR (
    p_message  => 'The employee name can´t be null',
    p_display_location => apex_error.c_inline_in_notification );

Elsif :P1_HIREDATE > sysdate then

APEX_ERROR.ADD_ERROR (
    p_message  => 'The Hiredate must be less than or equal to today',
    p_display_location => apex_error.c_inline_in_notification );

End IF;

insert into Emp(ENAME,HIREDATE) values (:P1_ENAME,:P1_HIREDATE);

end;

Submit the page and the result is:






You can show the notification on the page item too. Adding the p_page_item_name parameter the page item is highlighted on the page. The error message is displayed inline in a notification.

begin

If :P1_ENAME is null then

APEX_ERROR.ADD_ERROR (
    p_message  => 'The employee name can´t be null',
    p_display_location => apex_error.c_inline_with_field_and_notif ,
    p_page_item_name => 'P1_ENAME');

Elsif :P1_HIREDATE > sysdate then

APEX_ERROR.ADD_ERROR (
    p_message  => 'The Hiredate must be less than or equal to today',
    p_display_location => apex_error.c_inline_with_field_and_notif ,
    p_page_item_name => 'P1_HIREDATE');
Else

insert into Emp(ENAME,HIREDATE) values (:P1_ENAME,:P1_HIREDATE);

End If;
end;


apex error


The complete APEX_ERROR API docs, can be found on this link

Monday, July 4, 2016

Oracle Apex 5 Modal Window with Universal Theme

     Some people use modal pages to create modal windows, but in some cases it is recommended to use the modal region for it. This solution will take advantage of some of the features found in the APEX 5 Universal theme because it is easier to Develop and debug.

1. Create a new region and than set this template to inline dialog. On my test i named it to Dialog Region.

blog_1.png

2. On my example the modal will be open by a button click, so we need to create a button on another region.
3. Create a dynamic action which fires on button click and point to the created button.
4. Create a true action with the Execute JavaScript Code action and use the following for the code property. Don't forget to set the Fire On Page Load to No.

  this.affectedElements.dialog('open'); 

blog2.png

5. Now you have to create a button to close the modal. Create it on the modal region and do the same as above but now with the following code.
  this.affectedElements.dialog('close'); 


6. Refresh the page and test it.