Sunday, 5 May 2013

Custom SkipValidation in a fragment pageDef

Test 1 : 

-
SkipValidation=false in a fragment pagedef :
Entity level validations are executed.
All datacontrols validations of a page are executed.
And we see the other tabs validations errors. It is not the desirable behaviour for us.

Test 2:

- SkipValidation=true in a fragment pagedef :
Entity level validations are not executed when we change row ...
Validations of datacontrols are executed at the commit.
The other datacontrols validations are not executed.
Unfortunately, it is not the desirable behaviour for us because we need a validation when we change row ... entity level validation.

Test 3 :

- SkipValidation=skipDatacontrol in a fragment pagedef :
The same behaviour like test 2.
Why Entity levels validations are executed at the commit, not when we change a row. Is that normal?
The documentation said that with this value of skipValidation, the framework will execute validation
rules defined at attribute level or at entity object level for rows which are modified in the current transaction.
We dont understand the difference between SkipValidation=true and SkipValidation=skipDatacontrol


Test 4 : 

- SkipValidation=custom in a fragment pagedef : 


The custom validator in configured like managedBean in the adfc-config.xml with request Scope
The custom validator is not executed, but te behaivour is like test 2 (skipvalidator=true)

Test 5 :

- SkipValidation=custom in a main page PageDefs :

The custom validator is executed, but te behaivour is like test 2 (skipvalidator=true)
In these case we try to set the property SkipValidation of the pageDefs of tabs, but is not working.



public void validateBindingContainer(BindingContainer bindingContainer) {


DynTabManager tabMng = (DynTabManager)JSFUtil.resolveExpression("#{viewScope.dynTabManager}");

String selectedTabId = tabMng.getSelectedTabId();

for (DynTab tab : tabMng.getTabList()) { 

String tabPageDef = (String)tab.getParameters().get("pi_bindings");

DCBindingContainer binding = (DCBindingContainer) JSFUtil.resolveExpression("#{data."tabPageDef"}");


if (tab.getId().equals(selectedTabId)) {
// Normal validation in current TAB
binding.setSkipValidation(false);
} else {
//avoid validation other tabs
binding.setSkipValidation(true);
}
}
return;
}

No comments:

Post a Comment