Basic View Entity Screen

Hi,

I’m sorry if this is a really, really basic question. I am looking for a simple template view (i.e. read-only) screen for an Entity that I can alter the layout of the fields displayed. Is there a simple way of adding one like there is for edit/create?

Thanks

Hi Mark,

You can create such screen simply in CUBA Studio.

  1. Switch to the Data Model section in Studio and select the Entity
  2. Click New -> Generic UI screen
  3. Select Entity editor template
  4. If you already have an editor created, the Resolve conflict window will appear
  5. In this window replace “edit” by “view”: myentity-view.xml, com.company.demo.web.myentity.MyEntityView, demo$MyEntity.edit. The new screen will be created.
  6. Open this screen for editing and set editable=false for the fieldGroup element in the screen XML descriptor. Thus, the fields will become read-only.
  7. To change the order of fields on the screen, select fieldGroup in the components hierarchy, on the properties panel select fields and click Edit
  8. Change the order of properties using the arrow buttons in the table on the left

It all looks more complicated on the text than in Studio. Please let us know if it’s not what you asked for.

Hi Olga,
I have the exactly the requirement as above. I’ve created the View Screen, everything is fine. But i want to know, how to add the view action in the browser screen,