Follow Us on Twitter

Catching key strokes using Dynamic Actions in Oracle APEX 4.x

by Michel van Zoest on January 28, 2014 · 1 comment

One of the demands for a customer application built in Oracle Application Express was, that a part of the application could be completely operated by the numpad of a keyboard. This had to do with the physical aspects of one of the workstations. There was simply not enough room for a full keyboard.

When building an APEX application, you have several tools to your disposal to allow this. First of all there is the option “Submit when ENTER pressed” on text items that removes the need for buttons to submit a page.

Next there are some built in possibilities in Dynamic Actions. For example; there is the True Action setFocus that allows a developer to automatically put the focus on a certain item (for example the item that submits when ENTER pressed) in case of an event (like Page Load). With these two you can already build a simple page to navigate through the pages of your application.

One more demand was for a certain page to scroll back and forth using the plus(+) and minus(-) keys on the numpad. This also is relatively easy to do in APEX. It requires a Dynamic Action and one line of JavaScript.

Here are the steps to take when catching the plus(+) key stroke.

  • First create a new Dynamic Action
  • The event should be ‘Key Release’
  • As Item select one of the items on your page
  • Add a condition of type “JavaScript expression”
  • The value of this condition is “this.browserEvent.which === 107″ (107 is the plus(+) key, 109 is the minus(-) key)
  • Add an action to perform on this event, like an alert.

And that’s it!

The result should look like the following screenshot:

Key Release Dynamic Action ALT Key Release Dynamic Action Catching key strokes using Dynamic Actions in Oracle APEX 4.x, 4.0 out of 5 based on 3 ratings

Ratings:
VN:F [1.9.22_1171]
Rating: 4.0/5 (3 votes cast)

One comment on “Catching key strokes using Dynamic Actions in Oracle APEX 4.x

  1. You did it! Great job :-)

    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Previous post:

Next post:

About Whitehorses
Company profile
Services
Technology

Whitehorses website

Home page
Whitebooks
Jobs

Follow us
Blog post RSS
Comment RSS
Twitter