Wednesday 4 April 2018

Universal Theme - Side Navigation Menu Child Entry Icon Alignment

Hi,

There is an issue with the Side Navigation Menu Child Entry Icon Alignment in Universal theme if you are using APEX 5.1 or prior versions. Below image describes more about the icon alignment issue.













This can be fixed by an simple CSS. Below is the code.

/*CSS for Side Menu Child Entry Icon Alignment Fix */
.t-TreeNav .a-TreeView-node--topLevel .a-TreeView-node .fa {
   line-height: 32px;
}

As we need to apply this CSS globally to the application you can save this code as css file and upload it under Application Static files. Then refer it in 'Shared Components =>  User Attributes  => Edit User Interface =>  CSS File URLs section' of your application.

This is how it looks after applying the CSS.










This alignment issue has been fixed in the next version of APEX (i.e 18.1).But if you are still using the old version (i.e 5.1 or prior) then this workaround will save you. Hope this helps.

Cheers,
Prashanth

Tuesday 6 February 2018

Region Flip in APEX

Purpose of this post is to demonstrate region flips in APEX. 

The region flip feature provides a rich user effect in UI/UX of your application by flipping the regions without actually loading the page to toggle between the details.

Below are its implementation steps:

Step 1: In order to make the Flip function work, first you need to include jQuery flip.js on your page. Click here to download the file (flip.js - it's in the src folder in the download).
Step 2: Upload the flip.js file into Static Application/Workspace Files under shared components. Copy the Reference link of the file. i.e #APP_IMAGES#flip.js or #WORKSPACE_IMAGES#flip.js
Step 3: Edit the page where you want to have the region flip, Under Javascript > File URLs > paste the reference link got in Step 2. 
Step 4: Edit Page > Under Javascript > Execute when page loads > enter the below code 

$("#card").flip({
trigger: 'manual'
});

Step 5: Create your parent region that will hold the 2 new child regions, set static ID of parent region to 'card' or anything you want to call it, as long as you update the flip.js file above.
Step 6: For the 2 child regions, set the 'Column CSS Classes' under region Layout section to 'front' and 'back' respectively.
Step 7: Create respective button on each child regions, and call a dynamic action on Click of each button to 'Execute JavaScript Code' as mentioned below

'$("#card").flip('toggle');'

For more flip options refer the below URL:
http://nnattawat.github.io/flip/

Click here to see the DEMO of this feature. Use demo/demo to login.

Cheers,
Prashanth

Monday 18 September 2017

Interactive Reports: Button Positions

When we add any buttons to IR and select button position as "Right of Interactive Report Search Bar" we notice that the buttons gets displayed in right corner of the report. Looks something like below  image:


There is no pre-defined option within APEX to move these buttons to other positions. This can be achieved by using some custom CSS.

For example, If I want to align buttons right next to Action Menu in Interactive Report then I can use the below CSS:

.a-IRR-toolbar {
  display: flex;
}

.a-IRR-buttons {
  display: flex;
  flex-grow: 1;
  justify-content: flex-start;
}

Use the above code in the CSS inline section of the page. Result would be something like the image below:


Here is the link to the DEMO application: https://apex.oracle.com/pls/apex/f?p=110214:3
UserName/Password: demo/demo

You can play with different values of justify-content property to make the buttons display in different positions. It can take below mentioned values:
justify-content: flex-start|flex-end|center|space-between|space-around|initial|inherit;

Below are the details for each property values.
flex-start > Default value. Items are positioned at the beginning of the container
flex-end > Items are positioned at the end of the container
center > Items are positioned at the center of the container
space-between > Items are positioned with space between the lines
space-around > Items are positioned with space before, between, and after the lines
initial > Sets this property to its default value.
inherit > Inherits this property from its parent element.

Hope this helps.

Cheers,
Prashanth


Friday 31 March 2017

Universal Theme sidebar menu tooltip

If your sidebar text is too long, APEX truncates it to some fixed width. Here comes the use of Tool Tip option for the side bar. Also if you make the sidebar navigation menu collapsed by default and when only the icons are displayed, This Tool Tip will be helpful to understand the menu better.

Here are the simple steps to achieve this tool-tip functionality.

1) Create an Global Page (Page 0) if its not already present.
2) In Page 0, Create a Dynamic Action on Page Load.
3) Select Action as "Execute JavaScript Code" and paste the below code in its source.

//Tooltip for Menu Text
$("#t_TreeNav").treeView("option", "tooltip", {
    content: function(cb, node) {
        return node.label;
    }
} );
 //This tells the tooltip to show up for the whole node content including the icon.
$("#t_TreeNav").tooltip("option", "items", ".a-TreeView-content");

In the above piece of code "t_TreeNav" is the ID of the sidebar navigation tree which is set by default in Universal Theme.

Once the Dynamic Action is created, Run the application and hover the mouse through Sidebar menu to see the Tool Tip in action.

Below is the sample application which demonstrates the use of tool-tip.
https://apex.oracle.com/pls/apex/f?p=83384

Cheers!!!!

Interactive Grid - Remove Default First Row Selected

APEX 5.1 has an very powerful reporting feature called Interactive Grid (IG).
When you create an Interactive Grid with RowSelector, you might have noticed that by default the the first row gets selected. This is how the Interactive Grids are designed.

But there might be an requirement where none of the check-box must be selected on landing to the screen. Hence we need to remove the first row default selection in Interactive Grid.

This can be achieved from below simple code:

Use the below code when the page loads. You can either create an Dynamic Action or add this code in "Execute when Page Loads" section of the page Javascript


var ig$ = apex.region("emp").widget();
ig$.interactiveGrid("getViews", ig$.interactiveGrid("getCurrentViewId")).setSelection($());

Change "emp" to whatever your Interactive Grid static id is.

This should remove your default first row selection from your IG. Hope this helps.

Monday 6 March 2017

Refer Packaged Application Icons in APEX 5.0

Here is an easiest way to use some of the packaged application icons for your applications.
This can be done by including the packaged applications CSS file in your application, and reference the appropriate CSS class for the icon you need.

1) Navigate to Edit Application Definition -> User Interface, and edit the interface for your application.


2) Under Cascading Style Sheets add the this CSS file: #IMAGE_PREFIX#pkgapp_ui/css/5.0#MIN#.css
In your application create a div with a height and width, and include one of the icon classes to display the icon.

<div style="height: 100px; width: 100px;" class="app-application-standards-tracker"></div>

Here are the available packaged application icons:


Monday 4 August 2014

Ensuring a button is clicked only once

THE EFFECT
Click here to view the effect. You will notice that as soon as you click either of the buttons, the button is greyed out and its text is changed to “Submitted…”

STEP 1
Create a button of type “Create a button in a region position”.

STEP 2
Set the button’s target to be a URL.

STEP 3
If you do not want a confirm dialog with the button, set the button’s URL target to the following:
javascript:this.disabled=true;
this.value='Submitted...';
doSubmit('XXXXXX');

If you DO want a confirm dialog with the button, set the button’s URL target to the following:
javascript:if (confirm('Are you sure you want to?')) {
this.disabled=true; this.value='Submitted...';
doSubmit('XXXXXX');
}

In either case you should change the value of XXXXXX to be the same as the name of the button. This is the value that REQUEST will be set to when the button is clicked. By setting it to be the same as the name of the button it means that you can still use “When Button Pressed” conditions for this button.

Universal Theme - Side Navigation Menu Child Entry Icon Alignment

Hi, There is an issue with the Side Navigation Menu Child Entry Icon Alignment in Universal theme if you are using APEX 5.1 or prior vers...