Closed hschaefer123 closed 2 years ago
Hi,
thanks for the ticket! reproduceable in this jsbin tracked internally 1680214612
best regards, Tobias
Hi Tobias, BTW: is it possible, that grouping is also buggy (even using without clientmode?).
We have implemented server side sorting for the upper szenario, but switching between the two sort szeanrios only initially shows the list grouping. All other switches only show plain list items?!?
I also tried setting whole setItemBinding() instead of binding.sort(), but same result.
Regards Holger
Hi Holger, clientside: Grouping is a special kind of sorting. I would expect it to be broken in a similar way.
server side: should work - in your example you modified to group to xgroup: true is it such a small thing?
Best regards, Tobias
Hi Tobias, it still does not work even without the copy/paste type error ;-)
see http://jsbin.com/vecasoj/edit?html,output
I think, the group doe not work if using binding (or am i doing something wrong?). For me, it only works the first time with inline template inside xml view. After changing sort order (or in this case using scripting, the group will not be used).
I will create a ticket to see, if this is buggy!
Regards Holger
Hi, i am trying the same thing following directly instructions in the SAPui51 course. And i get exactly the same problem. Has it been fixed? what version of libraries shall i use to get the fix? thankxs and regards Wolf
Hi Wolf,
Unfortunately our internal tracking incident 1680214612 mistakenly got closed as duplicate.
I created 1880177368 internally. The responsible colleagues will provide feedback on this issue soon.
Best regards, Merlin
Hi Merlin, looking at the code in this issue i actually have only a simple search field and a pretty trivial callback. Might i help you in providing my coding? the app is very simple because it is just the excercises of the ui51 course . just let me know in case i can attach it here. Kind regards wolf
Does your code create a binding with operationMode: 'Client'
as well?
If yes, feel free to share your code as a jsbin or similar. If no, your issue might be unrelated to this one.
actually my binding is on an odata service i try to perform a search using search field and creating a filter object that is added to the binding. The property i'm filtering for is not searchable on the odata model itself so it perform the "client mode" filtering internally.
kind regards
Hi Wolf,
I've found the following lines in the openui5 course: openSAP_ui51_Week_2_Unit_4 page 4 (course exercise)
<List id="productsList" items="{ path : '/ProductSet', sorter : { path : 'Category', group : true } }">
This sorter is defined within the XML Template and resolved from the BindingParser which is slightly different than creating the sorter manually. Because when parsing the template a Sorter is created internally using the properties
When the sorter is passed to the Binding it needs to be created manually and the "code" from the template cannot be used. Instances of sap.ui.model.Sorter need to be passed to the Binding then. @see https://blogs.sap.com/2013/11/29/custom-sorter-and-grouper/ @see https://sapui5.hana.ondemand.com/#/api/sap.ui.model.Sorter @see https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v2.ODataListBinding
sorter: [new sap.ui.model.Sorter("CategoryName", false, true), new sap.ui.model.Sorter("ProductName", true)]
correct version
//note the grouping comparison needs to be implemented
Kind regards Tobias
Hi Tobias, thank you, you are so very kind. Actually i am not using a sorter but a filter. SAPUI51 course week 2 unit 4 ` <List id="productsList" items="{/ProductSet}">
Hi wolf, can you check the value of aFilter[0].sPath right before calling oBinding.filter? For me the filtering works. Maybe try to change "ProductID" to "ProductId".
Regards Tobias
Hi Tobias, you are right it is sPath empty. there was an attribute sName instead. I got it working playing around with the order of filter and filterOperations in the sap.define... but it makes no sense to me. I'm quite puzzled, but i believe it belongs to my learning curve. Thanks for your support kind regards wolf
Hi Wolf,
could you create a jsbin or paste your working code here, so that one can compare before and after and also have a solution?
Regards Tobias
Since there is no response from the author for more than 4 weeks I'm closing the ticket.
Hi, it's 4 years old :-D not 4 weeks
regards
Il giorno mer 4 mag 2022 alle ore 09:09 Florian Vogt < @.***> ha scritto:
Since there is no response from the author for more than 4 weeks I'm closing the ticket.
— Reply to this email directly, view it on GitHub https://github.com/SAP/openui5/issues/1094#issuecomment-1116993113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AITVSZMHOM6VHSZXKPH56LLVIIPBFANCNFSM4CL3SBXQ . You are receiving this because you commented.Message ID: @.***>
OpenUI5 version: 1.38.4
Browser/version (+device/version): chrome
Any other tested browsers/devices(OK/FAIL): not tested
I am currently binding an odata v2 entityset to a sap.m.list.
For performance reason i would like to use client side sorting/filtering. Inside controller, i am calling the binding sort function this way
I got the following error:
ODataMetadata.js:6 Uncaught TypeError: Cannot read property 'replace' of undefined
Inside debugger, sProperty is undefined!
Any ideas?
I think, client side sorting/filtering should be supported out-of-the-box, or am i doing something wrong?
What is the expected result? The client should sort the resultset clientside
What happens instead? Thrown error
Maybe you got an idea what is causing the issue. If not, please let me know and i have to create a working example with the issue inside.
Regards Holger