New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uniform handling of JPA and DTO entities in standard list/detail views #2788
Comments
Added methods
Removed methods
Behavior changesThe framework now doesn't make any difference between JPA and DTO entities when navigating to a detail view: it passes the entity ID in the route parameter. The detail view for DTO entity is supposed to get this ID and load the entity instance from some data storage using the load delegate. If the If the whole entity instance is passed instead of ID (e.g. when opening in dialog window), If the edited entity should not be reloaded from the data storage before setting to the data container, call RecommendationsOpening DTO entity detail viewPreviously, the framework automatically adjusted the process of opening detail views for DTO entities. In particular, when navigating, it didn't provide the entity ID in route parameters and instead passed the entity instance in If you have used this standard approach for navigation and want to keep it, you should replicate the old behavior in create/edit actions of the list view as in the following example for the
As you can see, the action handler methods set the empty route parameters and pass the entity in Opening detail view in dialog window should work as before without changes in list view actions. Both for the navigation and dialog mode, call
Setting non-new state for loaded DTO entitiesTo make sure the framework correctly distinguish new instances from already existing in a storage, call Assigning ID to new DTO entitiesIf the new entity ID is assigned by the storage, set the ID to the original instance too to let the framework match the saved instance with the original one. For example:
|
QA: test UI of add-ons using DTOs:
|
Currently due to #1330, #1357 and #1401 the create/edit actions and standard detail view behave differently for DTO entities:
findEntityId()
method which normally extracts ID from URL.To simplify work with DTO entities loaded from external data sources the UI framework should make no difference between JPA and DTO entities. The only thing the developer should do for DTO is to define a load delegate.
The mechanism of working with in-memory-only DTO entities like security models needs to be updated accordingly.
The text was updated successfully, but these errors were encountered: