cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (0)