on 07-31-2014 2:25 PM
Hey guys,
I am using a XML View and want to add a filter for the current date to control sap.m.List. In this case I hard coded the datetime and its working fine, but I want to retrieve the date dynamically.
<List
id="idMasterList"
mode="SingleSelectMaster"
select="handleListSelect"
items="{
path: 'ModelKundenInfos>/DeliveryHeaderSet',
parameters: {expand:'ToCustomer,LineItems'},
filters: [{path : 'Lfdat',operator : 'EQ',value1:'2014-07-03T00:00:00'}]
}" >
<ObjectListItem
id="idObjectListItem"
type="Inactive"
press="handleListItemPress"
....
</List>
Thanks and regards
Chris
Hi,
I am not sure if you still have the problem.
I have similar requirement and I am able to achieve it by following method.
I think at design time in XML view, you cannot give dynamic parameter. You have to set item binding in view controller. Please see following code here I am reading Country list base on user's browser language. Similarly you can update the code to create filter object dynamically for Date
var oItems = new sap.ui.core.ListItem({
key : "{CountryKey}",
text : "{CountryName}",
});
var oCustomerCountry = sap.ui.getCore().byId("idCustomerCountry");
var oSorter= {
path: 'CountryName',
descending: false,
group: true
};
var oFilters = new sap.ui.model.Filter("Language", sap.ui.model.FilterOperator.EQ, navigator.language.substr(0,1).toUpperCase()); // Dynamic parameter
oCustomerCountry.bindItems("/CountryCollection", oItems, oSorter, oFilters);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
yeah that's exactly how I solved it as well. But actually I though there is direct way at design time.
If u do the binding with a list, I had to define the list template again. This is how I solved it:
this.oObjectListItem2 = new sap.ui.xmlfragment("sap.ui.demo.myFiori.MeineRouteApp.view.fragment.DeliveryListItemTemplate", this);
this.oList.bindAggregation("items", {
path: "ModelKundenInfos>/DeliveryHeaderSet",
template: this.oObjectListItem2,
filters: filters,
parameters: {expand:'ToCustomer,LineItems,ToNote,ToDisponent'}
});
Regards
Chris
Hi,
Did you find the solution? I also have same requirement.
Regards,
Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.