Tuesday, 22 April 2014

Adding CSS buttons to your report

I've liked this concept ever since I saw the packaged applications use this technique:


I've finally gotten around to posting this in part due to some feedback on my sample application.

I used Chrome's inspect element tool to extract the CSS required to create this effect.
According to my notes I first did this when the Bug Tracking application used Theme 24.

You can then modify this to suit your requirements. I've changed the buttons from orange to green in my sample application. You can also change the size of the buttons using the last three attributes (highlighted) - something I've done to suit people's fingers tapping the screen in tablet based applications .

a.uButton.uButtonGreen {
  border: 1px solid #55a955;
  border-bottom: 1px solid #55a955;
  background: #55a955;
}
a.uButton.uButtonGreen span {
  background-color: #e6f0e6;
  background-color: #e6f0e6;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#e6fae6', endColorstr='#e6f0e6');
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#e6fae6', endColorstr='#e6f0e6')";
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e6fae6), color-stop(100%, #e6f0e6));
  background-image: -webkit-linear-gradient(#e6fae6,#e6f0e6);
  background-image: -moz-linear-gradient(#e6fae6,#e6f0e6);
  background-image: linear-gradient(#e6fae6,#e6f0e6);
  color: #404040;
  text-shadow: 0 1px 0 rgba(255,255,255,0.75);
  -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
  -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
  padding-bottom:10px;
  padding-top:10px;
  width:85px;
}
You could also rename the classes to help prevent clashes with existing usage.

You can place this CSS within the "Inline" CSS page attributes, or more appropriately in your own CSS file that you would place in your images folder, perhaps in /i/themes/my_app/custom/ or uploaded to your APEX workspace.
Some define their own custom virtual path /c/ in the application server.

You would then include this file in your application from within your page template, conveniently highlighted in red below.
CSS referenced in Page Template

In this case I defined a substitution string in my application properties, that way I only need to define the location once and refer to it in a number of templates.
Shared Components -> Application properties

Now in every report you wish to use the classes you apply the following properties to the link column.
The link text could reference data from the report using the #COLUMN# syntax
<span>#ID#</span>
And the link attributes tag the span with the class you wish to reference.
class="uButton uButtonGreen"

These link attributes are a powerful tool, I use them frequently in conjunction with dynamic actions using jQuery selectors.

Have fun!

Wednesday, 16 April 2014

Show APEX IR detail view by default

Since the Detail/Icon views were introduced to Interactive Reports in Oracle APEX 4.0, I've used the detail view a number of times to represent information in ways that don't even look like your standard columnar reports.

One example you may have seen was the original apexblogs.info - this was a detail view IR showing aggregated posts of APEX bloggers.
It's now hosted at odtug.com/apex and this appears to use an alternative method - Named Column report template. I now feel this is probably more superior and deserves it's own post.

I also thought the APEX 4.2 builder application search was another candidate, but looking under the hood it doesn't appear so. If you were just observing as a user you'd say ifthis wasn't implemented with an interactive report detail view, it certainly could have been.

Trouble is these Detail Views aren't shown by default. Good thing is this has a simple solution, though the mechanism may change in APEX5 or other versions.

All you need is to add this when the page loads, either under page attributes or as a dynamic action.
gReport.data.view('DETAIL');
'ICON' is the other accepted actual parameter.
Page attributes - JavaScript
And you may wish to exclude the IR search bar - allowing you to provide your users with a very customised, dynamic layout as soon as the page opens, and they won't even know it's an IR - though depending on the speed of your browser you may see the standard view rendered before the JavaScript kicks in.

Suggested links

Oracle Docs - Enabling detail view
Understanding detail view [video]
Oracle APEX Techniques - video course that includes this clip

Friday, 4 April 2014

APEX Shortcuts Use Case

Recently Martin described APEX Shortcuts, a shared component that I don't often use - and probably even less now.

APEX wizards create them for the delete process in forms, but I thought I'd describe an example of how you might use one for your own needs.

The sole purpose I've used them is to generate HTML text from PL/SQL - often for links to appear near text items. For example, you could use them to

  1. Provide a quick way to clear the text in a field
  2. Populate a date picker with today's date
  3. Generate a list of quick picks, derived from a ref codes table.
The last one is now superceded by a the Dynamic Quick-Picks plug-in.

To show the simplest example, here is how you can add a link to clear an item. First, define the shortcut as some PL/SQL that simply returns some generated HTML - the link that clears the item. Note we can use #CURRENT_ITEM_NAME# to substitute in the relevant item.

Create APEX Shortcuts from Shared Components
Then we refer to the shortcut name in the Post Element Text of the item. Note the "SHORTCUT_NAME" syntax, which should be in uppercase. This renders the shortcut value after the item.
Item property using an APEX shortcut
The final output will differ depending on your theme, but here is a screenshot from my sample app that uses a bare-bones theme 25.
Final runtime result
Relevant documentation can be found here.

What I would like to know is why they're called shortcuts!?

Monday, 31 March 2014

Off topic - 2014 predictions

Here are my predictions for 2014.

I realise that traditionally yearly predictions are made in the first month of the Gregorian calendar year... but I've been busy. So I'm going to make some predictions in my birthday month and see how things eventuate over the next 12 months. Many sites do this over the new year, and I do love the commentary when one looks back over the previous 12 months. It's amazing, well not really, how bad the "psychics" do.

While listening to my favourite podcasts over the new year I found myself thinking about stuff and I started noting some things down that while I didn't necessarily think would eventuate this year - I sure hope it comes soon! Other items just got me thinking where technology might eventuate at some point.

My evernote entry on these predictions were dated Jan 13th, and I promise I haven't cheated & backdated any predictions, not that any have already come to pass ... except one - see if you can spot it.
  1. Observational technology will enable astronomers to accurately determine the composition of exoplanet atmospheres and isolate even more "earth like" planets.
  2. There will be major outcomes regarding the sex scandals in the catholic church - broad statement, but outcomes that humanists will be agreeable to. Definitely Australia, hopefully worldwide. Faith in the church (pun intended) will recede further.
  3. In a similar vein, marriage equality will experience similar liberation racial issues received last century (some good news in March on this topic in the UK)
  4. Various worldwide easing of marijuana laws will facilitate more comparative studies which will eventuate into more targeted medical use with certain compounds.\
  5. A plane will go missing, sparking international interest and new conspiracies.
  6. In the nex twelve months we'll have another paradigm shift with smartphone capabilities - potentially relating to folding screen technology.
  7. Power storage technology is very slow moving, but we will overcome some big hurdles, providing order of magnitude increase in storage capacity and/or charging window.
  8. Augmented reality will become very popular in the "app" market, after experiencing slow and steady increases over the past few years, aided with Google Glass.
  9. We will learn key information about ocean ecosystems, such as cracking exactly what goes on with shark migrations - hopefully not too late due to us guiding selective pressures in the wrong direction
I think the faux-prediction is obvious, but I think you'll find none of the "professional" psychics & grief vultures will have predicted such a unique event.
My prediction on the outcome - few pieces of the wreckage will be salvaged, but confirmed as part of the plane. Conspiracy theorists will deny it & claim it all relates back to Rothschild. 
The black box will be recovered but possibly not for a few years and only by lucky, persistent searching. It will be determined the pilot went rogue.

My 5 cents

Wednesday, 26 March 2014

Advert: Packt celebrates 2000 books

No APEX5 blog post today, but it turns out today is the final day of Packt Publishing celebration of 2000 titles since their first book was published in 2004.
I like puns
I have the honour of being one of these titles with my Oracle APEX Techniques video series, and I've had the pleasure of reviewing a number of their books.

They have a buy one get one free offer but it ends today - which time zone I don't know so get in fast!

Tuesday, 25 March 2014

APEX 5 first peek - What I missed

When tackling early adopter versions I've enjoyed having a play before reading too much about it. I did look through the EA1 feature descriptions to get a feel for the sort of things to expect, but I waited before watching David's videos to see how easy it was to adapt to the changes - even though I wasn't concentrating on the new page designer itself.

It was certainly worth watching the videos in the end because not only does he describe the new features in the page designer really well, he outlines the state of play for the early adopter release.

So while I haven't gone too deep into the new page designer functionality, here are some less obvious features I think are worth mentioning.

New context menu options

I didn't notice the new options under the right-click when viewing components in the rendering/processing accordion options. I guess I missed these because I rarely use the Tree View.

So when David Peake pointed them out in this video - I agreed it would be a simple way to improve developer productivity, and I know I'd use them all the time.
  • Duplicate 
  • Delete
  • Copy to other page
How many times have we thought - wouldn't it be great if this could be done in one click?
Well, now it's done in two - but super fast, and no wizards.
Component Context Sensitive Right-Click
Copying (& duplicating) is great, but we've always got to be sure not to encounter what we call a cut & giggle, where you forget to change something minor during the process of copying. This is made worse when APEX misses a few attributes, or doesn't change the page prefix.

I've been on a project where copying dynamic actions to other pages was done frequently, and since they're a little newer they haven't had the time to perfect minor copy glitches - similar to those that used to appear copying pages in 3.x. Time will tell if this is still an issue, but we've been promised improvement.

Undo - viewing last change

Undo is one of the first features you might spot in the new page designer, but what I didnt' realise was the tooltip text you see when there is stuff to undo. Of course, I spotted this after I logged feedback suggesting we see a list of outstanding changes when we leave an unsaved page.
Undo Tooltip
Thankfully undo also works to restore deleted components - which may be a frequent accident with the new context menu option.

Autocompletion

When editing page templates I noticed a message under the text area to press ctrl-space to activate autocompletion - nothing happened there nor when using the modal edit (EA1) - but when editing using the Text Editor in the page designer it invokes an autocomplete.
Text Editor Autocomplete
You've probably seen this in products like SQL Developer, some people love it. Personally it's the first feature I turn off because I can't stand the lag it introduces. At least here in APEX it is only on demand.

Page designer search

While I did appreciate the search application feature that came with 4.x, I'm really liking this new feature available near the gallery in the middle of the page designer.
Page Designer Search
Results are instant, and when you click on a result the component is automatically selected and properties shown. Another big productivity booster.

Multi-item updates

Former Forms developers will particularly like this one - using the CTRL key you can select multiple heterogenous components and then update common properties in the editor in one go.
Multiple components selected

The property editor (which no doubt I'll continually also call a palette) shows only common properties, and those properties that differ will be shown with a triangle/delta icon with value redacted under a blue shade.
Forms style property palette
I loved this feature in Forms because you could quickly identify any differences between items, of course in addition to making changes in bulk.

There are also little red triangles above certain properties, but I'm not sure what it indicates. In Forms we saw something like this indicate a value differing from default - but it doesn't seem that here, not are they identifying common attributes. Perhaps the APEX team might elaborate at some point, unless I forgot it mentioned in a video - anyone?

User interface

Something you may have noticed I've missed is commentary regarding other user interfaces. I've just neglected to mention it so far.

There are new features regarding the mobile UI which I'll cover in another post some other day - though there may be enough changes for a few posts.

And disappointingly for my current project interests, the tablet UI has been bumped to 5.1. This is a real shame because it's been an interesting challenge to adapt a desktop interface to a 10 inch touch screen environment. I'm keenly awaiting what goodies the APEX team may provide to make this task easier.

-- Is there something you've seen so far that has excited you that I haven't covered?

Monday, 24 March 2014

APEX 5 first peek - Features not yet implemented

It's an early adopter release, the APEX team have come a long way, yet there are still goodies to come.

What's on it's way

Some features aren't quite ready yet. Some you'll see, others you'll find out when you click on them - so no doubt we'll see a second, maybe even third early adopter release.

Notifications

The first you may notice if you've had a play is the notification message - this will be much nice once the development team are done.
A bunch more are already listed in the known issues.

Utilised Shared Components

In the current release I use the Shared Components section on the right often to click on templates used by the page. I already miss it's presence as I play around, and I noticed David delicately skipped over this one during two of the videos ;-)
Shared Components used by the page
Early adopter release 2, I guess.

I found a Tags plug-in item type but that doesn't seem to be quite ready. There are a few Region plug-ins built-in that you can play around with already.

What's not included

Some features have been bumped to 5.1, and fair enough - the amount of work it must have taken to get the Page Designer up & running, the team is making sure they get everything right.

Multi-row Edit Region

At the KScope14 conference Karen Cannell hedged her bets and lost - her submittion What the Muliti-Row Edit Region Type Means to You and Your End Users will probably have to wait.
Not that I'm going (most unfortunately), one year I'll make the trip...

To find solace in this, based on what we're seeing with the new Page Designer, I very much look forward to what this multi-row edit region type will deliver. No pressure team...

Wish list

I had a look through my APEX 4.2 Wish List post and I've remembered other features that I've been waiting/hoping/requesting for a while that are still absent. Some of these items are resolved with plug-ins; some have lost proirity; some we won't know until documentation is supplied; some have been nailed; some simply don't exist anymore with the new Page Designer. Some we just won't know until the use case comes up once more.

What I was hoping for though was enhancements to the Build Option infrastructure, thereby aiding release management.

There are currently 59 other features categorised as "Planned" in the APEX Feature Request application. For instance, feature "ACNA" suggests substitution string :APP_PAGE_ALIAS will be introduced in 5.0.
The new features documentation usually covers stuff like this - I reckon there might be a few other new substitution strings.

Other nuggets of gold will surely be discovered over time.