in my UI screens, i sometimes have the requirement to instead of going directly from “browse” to “edit”, i need a screen in between. In other frameworks this is normally called something like “show” or “detail”. Often this is useful when the user should have the opportunity to get an overview of an entity before editing it.
One reason might be because the entity is just too big (with many 1:N & M:N relationships) to get a basic idea of it. So it should support the overview of the entity.
Another is, that there are a lot of actions that can be done on a particular entity. But these actions would take to much place in the browse screen. Also there is not a real need to directly do this things from the entities list. (Take this example of ms dynamics nav - contact detail screen for multiple actions on an entity).
Unfortunately CUBA doesn’t really support me with this UI pattern. Here are some examples, where i have problems when trying to do this manually:
- Actions in the top level of the “show”-editor can’t be used together with “constraintCode” and “constraintOperationType”
- programatic custom actions can’t really use BaseAction as a base class, because it implements “Action.HasTarget” which mean that it should be used in conjunction with a ListComponents (which is normally not present at the show editor).
- “related entities” can currently not be used in a show screen (i think i already created an issue for that which got resolved in 6.5 - i think)
- if i use the normal “test$Customer.edit” screen to be the show screen (because i want to stay as close to the CUBA UI pattern as close as possible) and add another button in the screen that opens the actual editor, the refresh on the table does not work anymore, because it has two hops
- in the show screen there is not really a component (especially in the field group) that only displays a value in a really read only fashion (just enabled=false works pretty good though)
To overcome some of the above mentioned issues is to just create a invisible table in the “show” page where you load only this item in the datasource and select it programatically.
I attached a simplistic example of the screen flow. It does not show all the above mentioned problems and fixes, but just to get an idea.
I have not a real idea how this should look like, perhaps we can have a chat about it.