Skip to Content
author's profile photo Former Member
Former Member

sap.m.select binding in xml view using expand query in sapui5

Hi, We need to bind some data to a sap.m.select and so we implemented the expand query in our backed and it seems to work properly returning the content of the sap domain

<link href="CampiSet('AGTITLE_MEDI')/DominiSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DominiSet" type="application/atom+xml;type=feed" title="DominiSet">
<m:inline>
    <feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="http://our.service/ZOUR_SERVICE/">
        <id>http://our.service/ZOUR_SERVICE/CampiSet('AGTITLE_MEDI')/DominiSet</id>
        <title type="text">DominiSet</title>
        <updated>2016-12-06T18:10:59Z</updated>
        <author>
            <name/>
        </author>
        <link href="CampiSet('AGTITLE_MEDI')/DominiSet" rel="self" title="DominiSet"/>
        <entry>
            <id>http://our.service/ZOUR_SERVICE/DominiSet(Id='AGTITLE_MEDI',Key='')</id>
            <title type="text">DominiSet(Id='AGTITLE_MEDI',Key='')</title>
            <updated>2016-12-06T18:10:59Z</updated>
            <category term="ZOUR_SERVICE.Domini" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
            <link href="DominiSet(Id='AGTITLE_MEDI',Key='')" rel="self" title="Domini"/>
            <content type="application/xml">
                <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                    <d:Filtervalue/>
                    <d:Id>AGTITLE_MEDI</d:Id>
                    <d:Key/>
                    <d:Value/>
                </m:properties>
            </content>
        </entry>
        <entry>
            <id>http://our.service/ZOUR_SERVICE/DominiSet(Id='AGTITLE_MEDI',Key='32')</id>
            <title type="text">DominiSet(Id='AGTITLE_MEDI',Key='32')</title>
            <updated>2016-12-06T18:10:59Z</updated>
            <category term="ZOUR_SERVICE.Domini" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
            <link href="DominiSet(Id='AGTITLE_MEDI',Key='32')" rel="self" title="Domini"/>
            <content type="application/xml">
                <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                    <d:Filtervalue/>
                    <d:Id>AGTITLE_MEDI</d:Id>
                    <d:Key>32</d:Key>
                    <d:Value>AMB. VETERINARIO</d:Value>
                </m:properties>
            </content>
        </entry>
        <entry>
            <id>http://our.service/ZOUR_SERVICE/DominiSet(Id='AGTITLE_MEDI',Key='12')</id>
            <title type="text">DominiSet(Id='AGTITLE_MEDI',Key='12')</title>
            <updated>2016-12-06T18:10:59Z</updated>
            <category term="ZOUR_SERVICE.Domini" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
            <link href="DominiSet(Id='AGTITLE_MEDI',Key='12')" rel="self" title="Domini"/>
            <content type="application/xml">
                <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
                    <d:Filtervalue/>
                    <d:Id>AGTITLE_MEDI</d:Id>
                    <d:Key>12</d:Key>
                    <d:Value>AVVOCATO</d:Value>
                </m:properties>
            </content>
        </entry>

We then use XML view in our frontend for trying to bind this dataset to a sap.m.select in this way

<Select id="AGTITLE_MEDI" items="{/CampiSet('AGTITLE_MEDI')/DominiSet}"><core:Item text="{Value}" key="{Key}"></core:Item></Select>

And then we bind all our data using view.bindElement this way

view.bindElement({path: "/Entity?$filter=Vkorg eq '2000' and Vtweg eq '10' and Process eq '02'&$expand=DominiSet"});

This worked quite well for a lot of time but then we added a lot of sap.m.select and we noticed that the framework made a lot of request to the backend slowing down the application.

I kindly ask how we can bind this data using the expand query so that the framework will make only a single request instead that once for items aggregation, we are currently trying different method to bind data but we are unable to make it happens.

Are we making something wrong on the backend side? Or our view are wrong?

Thanks for the attention.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.