Posts

Showing posts with the label ClientEvent

Tab Index with PanelFormLayout

Image
JDev: 12.1.3.0.0
Source: GitHub

This article talks about an interesting use case of JavaScript in ADF faces - the tab index.

By default when we use a panel-form-layout in ADF faces, the default behaviour of the cursor on tab is to go the next element as defined inside your panel-form-layout xml metadata.

So for a layout with 4 rows and 2 columns, the default cursor travel behaviour is something like this:


But what if I need a traverse pattern like this:


One not-so-simple and tedious way would be to to rearrange the items inside the form-layout. But for a large and complex form that is not an ideal option, and obviously that is not the solution I am planning to provide.

A simpler alternative would be to write a small JavaScript client-listener method, which would take 2 arguments - the previous item and the next item - and depending on these 2 values, it would find the item to focus on. The previous element option would be used when the user wants to go in the reverse direction with S…

Keyboard shortcuts on ADF table

Image
JDev version: 12.2.1.3.0 Source: GitHub
We often create applications which require very quick data entry. As a real world example, imagine creating a supply-chain application for an e-commerce vendor. The computers available at warehouses are not equipped with mouse either. A common request from such users is to enable the application with the usual keyboard shortcuts, in order to allow fast data entry.
Now, there is a great deal of discussion as to how much we should be overriding the default browser shortcuts. Some web developers are quite vocal in their view of not overriding basic browser shortcuts such as Ctrl+S, Ctrl+T or Ctrl+W. That discussion is beyond the scope of this blog.
This blog mainly deals with creating custom shortcuts, along with Control or Shift key modifiers.
The setup is simple - an ADF application which displays employee records from the HR schema. The user selects a record and uses keyboard short-cuts to perform operations such as:
a) copying and pasting a r…