Friday, February 17, 2017

ADF Editable Table - Recommendation For Data Entry Optimization

I will explain data entry use case related to ADF table. Specifically I will talk about a bit more complex case, when some columns in the table are set with AutoSubmit=true, to force values to be submitted to the server on change. This can be required when validation rule must be processed on value change or there are dependent re-calculated fields in the same row.

If you are using AutoSubmit=true columns in ADF table, it is easy to start loosing values from columns with AutoSubmit=false. Really? Yes - only, if table iterator is set with ChangeEventPolicy=ppr.

Let's do an experiment. First Name column field is set with AutoSubmit=true:


Iterator is set with ChangeEventPolicy = ppr:


Enter value for Last Name, field with AutoSubmit=false:


Change value for First Name, field with AutoSubmit=true and tab away:


Previously entered value for Last Name will be lost and focus will move to table header. Two bad things happened at once. First Name is set with AutoSubmit=true, this means it send value from this field in PPR request, and since table iterator is set with ChangeEventPolicy=ppr, in response it is refreshing table with data from the server. Obviously Last Name new value wasn't sent to server yet (AutoSubmit=false) and ChangeEventPolicy=ppr is reloading values on the client with whatever values are on the server. Technically this is not a bug, but is a critical bug from user perspective - loosing data.

If you have AutoSubmit=true columns in the table, make sure to set ChangeEventPolicy=none for iterator:


This time after changing value with AutoSubmit=true - other field values stay on the client and focus moves nicely to the next field:


When data is saved - changed from both fields are submitted to the DB:


Download sample application - GroovyADFApp_v3.zip.

6 comments:

Yazan Mohammad said...

Thank you for a valuable information.

Capil Verma said...

How to copy a child table row with master derail .
Example : department is master table which have employ as child table. If I copy any department row then emloyee will be copied in of that department in edit page.

What is the best practise to implement such type of scenario.

Page A have master details of department. Page B will have child details of department.

Julián Jiménez said...

Hi Andrejus Baranovskis, first of all thansk for your post.

However I followed your instructions and my table has disappeared. I have a createInsert/Delete ADF table, can you help me?

so thanks!

Andrejus Baranovskis said...

Dissapeared? :) How come :)

Andrejus

Julián Jiménez said...

Hi Andrejus,

Could you see my previous comment?
Can i write you to your mail?
Thanks!
I dont find the solution.
Regards!

Andrejus Baranovskis said...

Too busy preparing my OOW sessions content, thats why late reply. Please send your sample app by email, I will review it later.

Regards,
Andrejus