Closed zygimantus closed 1 year ago
Hello @zygimantus,
Thank you for sharing this finding. I've created an internal incident 2070018176. The status of the issue will be updated here in GitHub.
Regards, Nikolay Hristov GitHub Dispatcher
Thank you @NHristov-sap.
Hello zygimantus,
can you provide more details on this issue? How exactly are you searching on the backend? Do you add a filter on the binding? Can you provide a sample where we can debug this issue?
Regards Sebastian
Hello, @HerzogIgzorn , yes, I am using a custom filter function via filter property on TreeTable which in the end filters like this: oTable.getBinding("rows").filter(oFilter, "Application");
Not sure if I would manage to provide a sample because it would require to host somehow odata service.
Hi @zygimantus, I would expect that almost all request from this TreeTable filter on the hierarchy level. This is by design.
What issue are you facing with this behavior? How would you like to change it?
Relevant documentation: https://ui5.sap.com/#/api/sap.ui.model.odata.v2.ODataTreeBinding%23overview
Closing due to inactivity. Please feel free to comment if there's new input.
I am also facing the hierarchy level issue as 0 by default filter is going to backend when i am doing a filter
Hi @zygimantus, I would expect that almost all request from this TreeTable filter on the hierarchy level. This is by design.
What issue are you facing with this behavior? How would you like to change it?
Relevant documentation: https://ui5.sap.com/#/api/sap.ui.model.odata.v2.ODataTreeBinding%23overview
@RandomByte This works nice for initial display of the table. The problem is when I want to filter with certain keywords (for example, 'name startsWith B') without considering hierarchy level , hierarchyLevel eq 0 (or rootLevel) is automatically added to the request sent to backend odata service. Is there a way to remove this deafault hierarchyLevel filter?
Hello!
I am currently working on the OData V4 "TreeBinding" and thus would like to learn from the past. I did not really understand which negative effect this hierarchyLevel eq 0 has on the request (or response, probably)? Can you please elaborate a bit more?
Best regards, Thomas
@ThomasChadzelek
Hi, thank you for your quick reply.
In my case, I bind TreeTable with OData V2 (operationMode SERVER) and rootLevel set to 1. After initial display (here only data of hierarchyLevel eq 1 is displayed), the requirement is to be able to filter this table with search keywords. I use this syntax to filter but there are no results.
oTreeTbl.getBinding("rows").filter(oMyFilter, FilterType.Application)
When I checked the network tab, the request was in this format (url-decoded)
$filter=hierarchyLevel eq 1 and (substringof('searchKeyword', description))
hierarchyLevel was added automatically, thus resulting in wrong filter.
Is it possible to remove this default filter?
Tracking internally as 2280186931
Is this issue being fixed? May I ask the expected date of release?
Hi @HannaNguyen-new,
Is this issue being fixed? May I ask the expected date of release?
No, we are not even sure whether it is an issue on the client or server side. We need to investigate an example. To that end we had contacted a colleague by the same name as you. So far without a result.
What we can do here is to double-check expectations. We are displaying a hierarchy. When filtering or searching, the expectation is that all nodes matching the filter/search and all parents of these matching nodes are forming the hierarchy. It would then be possible to request level 0 and get all the matching nodes in level 0 plus all parents of matching nodes in level 0.
Is that also your expectation? Is that also how your service behaves?
Best regards Mathias.
Hi, @uhlmannm
In our case, this is an issue on client side because the request is sent with hierarchyLevel eq 0 (rootLevel is 1 in our case though).
the expectation is that all nodes matching the filter/search and all parents of these matching nodes are forming the hierarchy
-> Our application uses sap.ui.table.TreeTable and I suppose this is what sap.ui.table.TreeTable expects to get. Our application returns results satisfying this condition so as to form hierarchical structure( We use CAP java handlers to deal with this). Matching nodes are not necessarily in level 0 (or root level). Therefore, except for initial display, I think this default query is not necessary.
$filter=hierarchyLevel eq 1 and
Hi Hanna,
as written before, we need to analyze what is happening with an example. Please provide an example! Also, if you are working for SAP, I strongly encourage you to contact me internally, as this makes organizing the analysis much easier.
Best regards Mathias.
@uhlmannm I'm not working for SAP, our team is developing an app using SAP technologies. It might take some time but I'll try providing a sample.
Hello,
I was able to have a deeper look at this issue. If you are using tree tables as mentioned above, the underlying tree binding requests the data. First all elements of the root level are requested. So the binding creates a request with the filter HIERARCHY_LEVEL eq 0
(as in the example above; other levels are also possible, for example 1 as decribed by HannaNguyen-new).
If the application now filters for any other property, the tree structure must not be corrupted, that means all parent nodes for the matches have to be contained in the result.
In the example above, $filter=hierarchyLevel eq 1 and (substringof('searchKeyword', description))
, the backend service has to apply the non-tree-structural filters substringof('searchKeyword', description)
first. The result has to contain all parent nodes up to the root for all matches. After that the filters for tree-structural properties have to be applied (for example hierarchyLevel eq 1
), which filters the root elements of all matching results. That's the expected response for this request.
This is the way how TreeBindings work.
Best Regards, Sven
I am facing a issue with a TreeTable. Suppose I have a following rows binding:
rows="{ path : '/MY_TABLE', parameters : { countMode: 'Inline', treeAnnotationProperties : { hierarchyLevelFor : 'HIERARCHY_LEVEL', hierarchyNodeFor : 'HIERARCHY_RANK', hierarchyParentNodeFor : 'HIERARCHY_PARENT_RANK', hierarchyDrillStateFor : 'DRILL_STATE' } } }"
If I am doing a search in this grid table on a back-end, it seems that HIERARCHY_LEVEL eq 0 is added automatically. Is there a way to modify this sap.ui.model.odata.v2.ODataTreeBinding functionality?