During a migration from ADF 11g to 12c (12.1.3), I figured out some things you have to care of.
The first thing is that pages and fragments are based on Facelets, now. The default technology in 11g is JSP and JDeveloper 12c offers a converter to convert between these technologies. This converter changes the tags in the header of the pages and fragments, adapts the libraries in the ViewController project and changes the file extensions from .jspx to .jsf (.jsff stays the same).
New headline in a page based on Facelets:
<ui:composition xmlns:af=http://xmlns.oracle.com/adf/faces/rich xmlns:f="http://java.sun.com/jsf/core" xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces" xmlns:ui="http://java.sun.com/jsf/facelets">
Old headline in a page based in JSP:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces" xmlns:ui="http://java.sun.com/jsf/facelets">
The converter is doing a good job and also checks the login/error page in web.xml to switch the extensions. You have to take care about the used resource bundles inside a page. After conversion, the entry of the variable which point to the correct resource bundle file is missing. You have to add one label of a component via the “Select Resource” wizard – afterward the entry is available again.
Oracle did a consolidation of different buttons and links which are part of 11g. In 12c only af:button and af:link are available, the old ones (af:commandButton, af:commandToolbarButton, af:goLink, …) are deprecated now.
If you switch to the new components you have to take care of the new default values of a af:button. The property “partialSubmit” is “true”, now! If you miss the explicit settings to false, the button will behave differently because of the new partialSubmit functionality. The result can be that different things do not refresh anymore or popups with “autoCancel=true” do not close!
Hint: Image as the child of a link.
The new af:link cannot hold an af:image as the child anymore!
In 11g it was possible to use invokeActions in the binding layer. The idea behind this is the execution of an action or a methodAction because of an event (f.e. entry of a page). This usage is deprecated, now.
The smart way to do the same is the usage of bounded task flows and the possibility to execute a methodAction in the control flow before the page appears. This offers the pre-filtering of data or other pre-executions between the switch from one fragment to another.
New transient attributes with groovy in VOs untrusted
If you create a new transient attribute in a view object in ADF BC und you fill its logic with groovy, there exists a new property called “trustMode”. This property is not visible in design mode – you have to switch to the source to see it. This trust mode is set to untrusted as long as you set it manually to “trusted”. This is needed to have the same behavior as before! Otherwise, it is not correctly evaluated.
Designtime does not recognize all scopes
The scopes of a bean instance on a task flow
are not recognized correctly in JDeveloper anymore. If you try to add a method to a button and use the EL builder to select the method out of the EL tree then the bean is not available. Even if you write the correct EL expression manually it is marked yellow in JDeveloper in design time but in runtime it is still working without problems! This is a really ugly bug and maybe happens on windows environments more often.
ValidateRegExpr also validates empty values
It is the default behavior in JSF 2.0+ that empty values are validated with regular expressions, too. The result is that you are fored to fill in values to fields which are not required in 11g. To avoid this behavior we have two possibilities:
- The regular expression hast o accept empty values, too (f.e. change a „+“ to a „*“)
- Avoid the validation of empty values globally in a context parameter in the web.xml file
<context-param> <param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name> <param-value>false</param-value> </context-param>
If you try to set a value to a bean with the help of a af:setPropertyListener below a button and inside the method on the action you want to use this value in the bean then this value is not set. The reason for this is that the action is fired before the setPropertyListner can set the value to the bean. In 11g it behaves the other way around.