cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Annotations & smartfilterbar control

yanev
Participant
0 Likes
839

Hi community,

I'm trying to use the smartfilterbar. I'm working in Eclipse with JS views.

The problem is when I call this element in the view I don't get the input field, only the buttons on the side:

I know that my $metadata is generated, but I'm missing the Annotation tags in the file(which as I could read in some posts are the key tags to why this element is showing or not showing any data). Those posts, that I'm referring to, were for the smarttable element but I'm guessing that tag is important for all smart controls (please correct me if I'm wrong).

This is my gateway service:

I want to be able to filter by Qmnum property of the EntityType oList so I've checked it to be filterable.

The metadata is as follows:

As you can see no Annotation tags. BTW, when I created the service project i chose the first option: 'Service with SAP Annotations'.

There's good documentation in the tutorials for the smart controls but I don't see anywhere explained how the Gateway service is build(SAPUI5 SDK - Demo Kit).

Can anyone assist me on this issue?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Sashko,

I don't know if you found a solution yet, but I think you want to see Qmnum field int he advanced area of the filterbar.

You can achieve this by adding a ControlConfiguration to the filterbar, for example:


<smartFilterBar:SmartFilterBar entityType="oList" id="smartFilterBar" >

       <smartFilterBar:controlConfiguration>

            <smartFilterBar:ControlConfiguration groupId="_BASIC" key="Qmnum" visibleInAdvancedArea="true" />

  </smartFilterBar:controlConfiguration>

  </smartFilterBar:SmartFilterBar>

Greetings

Nils

yanev
Participant
0 Likes

Hi Nils,

I didn't find a solution and decided to go without the smartcontrols. However I know how to call the element in front-end, the problem was the $metadata file and SAP Gateway that wouldn't generate annotation tags. If you have any tips on that please share for future reference.

Thanks

Former Member
0 Likes

Hi Sashko,

if you want to add annotations to your service, you can redefine the Define method in your *_MPC_EXT class. Now you can add the annotations that you want. Here is a little example for the LineItem annotation.

It is also possible to create a new project with the type "Annotationmodel for a referenced Service" (or something like that). Here is a little tutorial:

SergioG_TX
SAP Champion
SAP Champion
0 Likes
yanev
Participant
0 Likes

Hi Sergio,

I'm not sure how that can help me, since it's not described how those instance annotations are generated in the $metadata file.