Skip to Content
0
Former Member
Jan 30, 2017 at 03:41 PM

Issue with data binding on sapui5 [Same value is showed in my list.]

181 Views Last edit Jan 30, 2017 at 04:06 PM 6 rev

i have the next issue on my app made in sap web ide with sapui5 app template.

i want to show some values, the values are retrieved by a search field, everything works fine, but the issue i have is, the searched values what are shown are the same. in all entries.

Data showed on the app.

on the left side, the values must be differents, so i don't know how is not working. here are my code.

<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout"
	xmlns:f="sap.ui.layout.form" xmlns="sap.m" xmlns:sap.comp.variants="sap.ui.comp.variants" controllerName="com.my.controller.List">
	<App>
		<pages>
			<Page title="{i18n>title}">
				<content>
					
	<List items="{path:'/PTOS_INSPSet'}" id="puntosList" growing="true" growingThreshold="10" growingScrollToLoad="false" mode="SingleSelectMaster" selectionChange="onItemSelected">
		<headerToolbar>
			<Toolbar>
				<Title text="{i18n>puntosListTitle}"/>
					<ToolbarSpacer/>
				<SearchField width="50%" search="onFilter"/>
			</Toolbar>
		</headerToolbar>
		<items>
			<ObjectListItem title="{Userc1}" >
				<firstStatus>
					<ObjectStatus text="{IEbeln}"/>
				</firstStatus>
			</ObjectListItem>
		</items>
	</List>
</content>
			</Page>
		</pages>
	</App>
</mvc:View>
<br>

this in on the view.

and this is my controller por the button search.

<code>   
 onFilter:function(oEvent){var aFilter =[],
 sQuery = oEvent.getParameter("query");
if(sQuery && sQuery.length >0){
       aFilter.push(newFilter("IEbeln",FilterOperator.Contains, sQuery));

}
var oList = this.getView().byId("puntosList");

var oBinding = oList.getBinding("items");
oBinding.filter(aFilter);}

all of this is retrieved from a private odata service declared on my manifest.