How To Avoid The JBO-27014 Error During The AutoSubmit
When your ADF Faces page includes a component with the property autoSubmit set to true, you get the following error:
JBO-27014: Field <fieldName> in <AppModule>.<ViewObject> is mandatory for a component with the property immediate set to true.
This happens f.ex. when you try to populate a Description field as soon as the end user typed the Code value.
This error is raised because of the immediate on the component, what implies that the component's value will
be validated before any input components that do not have the immediate
attribute set to true.
At the time of the validation, this component hasn't got its value yet and the error is raised.
You can easily workaround this problem as the following:
- in the backing bean, add a boolean variable ppr true when a Partial Request occurs:
(...)
import oracle.adfinternal.view.faces.renderkit.core.xhtml.PartialPageUtils;
(...)
private boolean ppr;
(...)
public void setPpr(boolean ppr) {
this.ppr = ppr;
}
public boolean isPpr() {
FacesContext fctx = FacesContext.getCurrentInstance();
return PartialPageUtils.isPartialRequest(fctx);
}
(...) - use it in the required property of the mandatory field:
<af:inputText ...
required="#{! backing_validation.ppr}"
immediate="true" ... />