I created three new helper classes with wide usage potential. In specific cases they can significantly simplify the code and make it re-factoring friendly and even faster because there is no need to reference a view object to get an attribute value. I already use them on my daily ADF tasks.
-----------------------
In short (and exciting)
-----------------------
(1)
Class DynMap
This is helper class to mimic function call from an EL statement, with one passing parameter.
(2)
Class DynMap2
This is a variant of the upper class allowing you to pass two parameters to a function from an EL statement.
Following the same rules you can create corresponding classes to serve 3 and more parameters, too.
(3)
Class DynMapIn
Cool small class to test if some (binding) value is included in a final set of values.
----------------------
In detail (and boring)
----------------------
Currently, EL (Expression language) on ADF platform doesn’t support calling functions with parameters. For example you might want to write a (very logical) function call like this:
...but you can’t do it in ADF. The standard approach is to create a getter on your managed bean, and there to read the attribute from the bindings and do the logic.
And that’s what we usually do, and in most cases it is the only way. A negative consequence of doing it this way is that it that the code cannot be re-factored, because of strings used to reference objects.
I got an idea from how ADF page is using bundles for labels, as it passes a parameter of a key to return associated value. So I used the same idea and constructed a kind of dynamic maps, where the key returned is not a fixed value, but is calculated at the moment of the call. Then I wrapped it all in an easy to use classes.
Hello! My name is Sasha Stojanovic. I am involved professionally in programming from 1990. I've been using many mainstream and even some exotic technologies and frameworks in developing real world applications. I am specialized in creating working bridges in situations when there is no out of the box solution, from audio real-time data processing to enterprise data intensive client and server applications.
I will present here some interesting and (hopefully) reusable programming solutions I have created during my work on ADF - Fusion applications.