Wednesday, August 28, 2013

ADF 12c - Target Tag to Enhance PPR Rendering

There is new tag in ADF 12c called target. This tag in some use cases can substitute PPR dependencies effectively and help to avoid unwanted validation errors in data entry process. More about this tag you can read from ADF Faces 12c documentation - 8.3 Using the Target Tag to Execute PPR.

I will demo use case of LOV and dependent mandatory input text field. Selected value from LOV should update mandatory text value. With ADF 11g PPR dependency you will get validation error for required field, before LOV will be loaded - since LOV will try to refresh dependent input text even on load, not only during return.

Here you can see typical PPR dependency between LOV and input field. LOV is set with auto submit and there is partial trigger specified for input text:

We insert new row to make all fields to be blank:

Try to open LOV, validation error for dependent mandatory field will be displayed:

Let's use target tag as per documentation referenced in above link. There is no need to set auto submit and partial trigger dependencies. Only define target tag to be applied for LOV and render changes in text field:

LOV opens without triggering validation errors in required field:

Selected value is returned from LOV and set for dependent text field automatically:

Placeholder - another new feature in ADF Faces 12c. We can provide help text describing empty field:

This is just another property for the input text component:

Download sample application -


Anonymous said...

Thanks for this post and sharing knowledge.

caromeva said...

hello, can perform the same functionality in ADF, since I have no ADF version 12, can not use the TARGET tag. Any help please

Andrejus Baranovskis said...

You should use AutoSubmit=true and PartialTriggers property in ADF versions prior 12c.


caromeva said...

Okay, I'll use what you state.
But I have a question, my apologies, I'm learning ADF.
If I have a form and I need to validate that all fields possess a value or type other than empty as they meet all fields is provided, to enable a button to perform an action. I must generate a partialTriggers to display a red asterisk indicating that the value or a message with a validator as foul and I can give you the indication that the button is enabled once the fields are data. I understand the logic, but as unaware theme partialTriggers not understand how it works.

Best Regards ;)