« Lookup Fields | Main | invokeAction Invoked Twice »

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:

  1. 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);
    }
    (...)

  2. use it in the required property of the mandatory field:
    <af:inputText ...
                  required="#{! backing_validation.ppr}"
                  immediate="true" ... />

Comments (3)

bmgan:

i have added same code, in my case i have few 10 fields which distributed in two different tabs.

if we keep some manadatory columns in second tab. when i move from first tab to second tab. it showing rquired field error.

pls. help us to resolve.

Didier Laurent:

This should work for any PPR (Partial Page Rendering).

The point is that you create a boolean switch in your bean for deciding when the "required" property should be evaluated to true.

This can be, f.ex. when you reach a certain point in your process flow, ...

Regards,

Didier.

In JDeveloper 11g, replace
import oracle.adfinternal.view.faces.renderkit.core.xhtml.PartialPageUtils
with
import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PartialPageUtils

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on April 2, 2008 7:06 AM.

The previous post in this blog was Lookup Fields.

The next post in this blog is invokeAction Invoked Twice.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle