Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

sapui5 - How to bind filter values in XML view

I am developing an app using worklist template of Web IDE. I got stuck in with an issue in binding filter values to items attribute of sap.m.Table along with OData - EntitySet path. As you can see in below screen shot, value1 needs to get value of property "name". I guess the syntax that I am using might be wrong.

Please suggest on how to pass dynamic values to filter.

Object.view.xml

With the above code in XML view I am seeing below show values in back end. enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unfortunately, UI5 doesn't support binding syntax for filters and sorter yet. The strings in value1 (and value2) will not be parsed but taken literally. And it looks like such bindings won't be supported in near future either despite being on the backlock and one of the highly requested features.

Until then, we've to use bindItems, set sap.ui.model.Filter instances on the filters property of the binding info object, and get the filter values from the desired model manually instead of using binding syntax.

Example: https://embed.plnkr.co/AoIZI4/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...