jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
693 stars 124 forks source link

Base view class and Studio view template for read-only show page of an entity #3833

Open alexbudarov opened 3 weeks ago

alexbudarov commented 3 weeks ago

It would be great to have a base view class for cases when we need a read-only details of an entity.

Like https://marmelab.com/react-admin/ShowTutorial.html in React Admin.

For example:

Unexperienced devs are afraid to create such views from scratch. They are using StandardDetailView as base class, and after they get some problems such as:

Read-only show page most likely needs to have read-only data context.

mariodavid commented 2 weeks ago

I can only back that up.

I’ve often seen this type of functionality needing manual implementation, and it was always challenging to get right. Typically, using a StandardDetailView (or its CUBA equivalent) led to state changes being managed under the hood through services, which often caused UI issues like inconsistencies and unexpected behavior.

With Jmix 2, even refreshing views is not as straightforward as before. In many cases, we opted for a Blank View instead of StandardDetailView to work around these limitations. However, this approach isn’t ideal either, as it lacks Jmix’s built-in scaffolding and attribute management.

In fact, in almost every company I’ve worked for, we needed some variation of this kind of view.