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.
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.