icon-arrow icon-check icon-mail icon-phone icon-facebook icon-linkedin icon-youtube icon-twitter icon-cheveron icon-download icon-instagram play close icon-arrow-uturn icon-calendar icon-clock
Werken bij Whitehorses
Blog 28/01/2014

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

Catch

Integratiespecialist
Michel van Zoest /
Integratiespecialist

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

Overzicht blogs

Geen reacties

Geef jouw mening

Reactie plaatsen

Reactie toevoegen

Jouw e-mailadres wordt niet openbaar gemaakt.

Geen HTML

  • Geen HTML toegestaan.
  • Regels en alinea's worden automatisch gesplitst.
  • Web- en e-mailadressen worden automatisch naar links omgezet.
Integratiespecialist
Michel van Zoest /
Integratiespecialist

Wil je deel uitmaken van een groep gedreven en ambitieuze integratiespecialisten? Stuur ons jouw CV!