Posts tagged client side
ADF client-side architecture – Select All
0A little while ago I got a very nice challenge: play around with the ADF client-side framework.
The customer had a table where users could multi-select via an extra column with checkboxes. Header of that column also contained a checkbox to select or deselect everything at once. For example:
It was implemented using autoSubmit and partialTriggers. Due to the roundtrip to the server the response time was low when having a lot of rows. To speed it up, I was asked to look if (de)selecting all rows could be done on the client.
Never having worked with that part of ADF yet, I started searching and quickly found the Oracle documentation, but actual examples to clarify some topics.. hmmm not so much. The use case is quite specific but I thought it would still be nice to blog about it to be at least an example of some of the client-side functionality for other people in need. (more…)
ADF 11g – implementing conditionally required input fields – by playing client side hide and seek
7The requirement I was dealing with today in ADF 11g Rich Client Components was the following: we have an input field that is required under certain conditions. Only when one of this cluster of fields has a value, is it required. Otherwise it is optional. The use case was that the fields represent a detail record. There does not need to be a detail record (optional) but if there is one (one of the fields in the detailrecord has a value), then certain fields are mandatory.
The desire was to dynamically set the required-ness of the inputText – depending on whether one of the items in the detail record cluster has a value or not. Dynamically means that when something changes with one of the items, the conditionally required item is immediately refreshed to either required or optional.
It turned out to be fairly easy to implement: the required attribute can be set using an EL expression that refers to a bean method. In the bean we can easily check the values of the other items and determine whether or not based on that assessment the inputText component is mandatory or not. By setting autoSubmit to true for all the items that determine the mandatoriness – and by adding the More >
ADF 11g – Extend and Override standard client side behavior by manipulating the Javascript prototype
0This article describes a way to extend and override the standard behavior of ADF client side JavaScript libraries. In this particular case we needed to learn about the client side validation errors in order to feed our expertise manager: when the user submits the form, client side validations are performed and when errors are found, these are presented to the end user. We would like to intercept this standard flow and also listen in to the list of validation error messages that will be shown to the end user.
A little debugging using Firefox quickly made it clear that the submitForm() method is invoked when a command button is activated and that it in turn (indirectly) makes use of the function processValidators() on the AdfHtmlPage object. This function will return true or false, depending on whether any validation error messages were produced by the collected validators that fire.
We can extend this function – without having to change any of the source code. The standard JavaScript way of overriding a method on an object is through the prototype of that object – and a reference to the original function.
The steps are:
Recent Comments