cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Field Group to a Fiori Elements Object page

lanii
Member
5,827

Hello everyone, I am working on a Fiori Elements application which should have a list report page with sales orders and corresponding object pages for each sales order with their items.

This works, but I'm trying to add a field group to the object page, as shown here. I cannot make it happen to create the field groups or display any of them. I copied the exact code, so it seems as if the error is not in the code itself..?

I'm using Eclipse with ADT to create the cds views and metadata extensions, SAP Web IDE to create a template app, and Fiori 1809. The service is activated in the maint_services transaction. The annotation file is then successfully transferred from the backend to the front end and loaded within the app, as things like @UI.lineItem: [{ position: 20 }] work perfectly.

I used

   @UI.facet: [{
               label : 'General Information',
               id : 'GeneralInfo',
               purpose: #STANDARD,
               type : #COLLECTION,
               position: 10
           },
           {
               label: 'Basic Data',
               id : 'BasicData',
               purpose: #STANDARD,
               parentId : 'GeneralInfo',
               type : #FIELDGROUP_REFERENCE,
               targetQualifier : 'BasicData',
               position: 20
           }]

and

@UI.fieldGroup: [{ position: 20, qualifier: 'BasicData' }]
    PSPElement;

both inside of my metadata extension. Is this the correct approach? (Adding both to the cds view changed nothing..)

I feel like there is something basic I am missing, but I could not figure it out yet. Apart from basic annotations like lineitem and selectionfield, no other annotation worked, so the problem might not be exclusive to field groups.

Thanks for your help 🙂

Accepted Solutions (0)

Answers (3)

Answers (3)

maheshpalavalli
Active Contributor

Hi Simon,

I ddinlt go through your code completely, but you can check this blog, where I've used field group and ui.facet annotations for reference

https://blogs.sap.com/2019/02/08/myinbox-ui-generation-using-cds-views-and-ui.facet-annotation/

The issue most probably might be coming from the annotation file that gets generated in the ui5 list report template app. There it automatically generates the facet annotations in the ui annotation file. What you can do is, delete that annotaions in that file and make sure the ui.facet annotation is taken from the CDs view only, else update annotations in the ui annotation file

Thanks,

Mahesh

fse
Discoverer
0 Kudos

ok so far mahesh, but how is the facet id="GeneralInformation" displayed on the page?

for me it does not

szebenyib
Explorer
0 Kudos

Hi Simon,

did you find a solution for this?

pmcfarling
Participant
0 Kudos

add a label to the @UI.fieldGroup annotation. i.e.

@UI.fieldGroup: [{ label: 'PSP Element', position: 20, qualifier: 'BasicData' }]