Wednesday 25 February 2015

validating attributes in pagedef's variables iterator

In the classic ADF stack validations are propagated from the model (entity) up to the view (pages). It is easy. Harder task is when DataControl is based on other type of data source - web service, JMX or just POJO. I'll use Java class to describe how validation can be added in easy, declarative way. First of all setup of the application - implementation and Data Control:





The simplest possible Data Control is there. Now the sample web page:


Now drag and drop the method invocation as ADF Parameter Form, leave defaults:




If we consider a validation flow, it goes through page definitions. How to practically mix with that layer? Please go to the page definition and check what has been created. In variables iterator there is one new variable defined. Select it and go to Property Inspector.


My artificial business requirements specifies that field as mandatory, at most 8 chars and only letters. Above I've implemented two of them. How to handle third one here? Select the node in the Structure window and right click on it:



Fulfill the pattern and run the application. With "test" and "test2" options.