Hi Isomorphic,
I have a problem with an aggregation operation binding and using the results of this in a SelectItem.
Before I try to create a testcase (would have to do this on my computer and not in the showcase as I need to edit .ds.xml) I wanted to understand that my thinking is correct.
Imagine the supplyItem DataSource being used as followed:
My assumption is that even though I'm setting valueField: "category" somehow the count (=itemID) field is still seen as primaryKey and having double values here causes this problem.
So I think there is a problem with the primaryKey somehow luring in the background even though I set a different valueField.
I wanted to double check with you that this setup is expected to work. If not, what am I supposed to do here?
In general an aggregation that does not include the primaryKey in the groupBy (an then it's not really an aggregation, as all primaryKeys will be different) will result in either no value for the primaryKey or possibly doubled values like in my case.
The only other solution I could imagine is having a separate DataSource for this with category as primaryKey. But that defies the idea of operationBindings a bit IMHO if I have to duplicate DataSources for every aggregation.
Best regards
Blama
I have a problem with an aggregation operation binding and using the results of this in a SelectItem.
Before I try to create a testcase (would have to do this on my computer and not in the showcase as I need to edit .ds.xml) I wanted to understand that my thinking is correct.
Imagine the supplyItem DataSource being used as followed:
- TextItem for itemName
- SelectItem that uses that TextItem to filter itemName in pickListCriteria
- valueField: "category"
- displayField: "category"
- picklistFields: [{name:"category"},{name:"itemID", title:"Count"}]
- optionDataSource for this SelectItem is a supplyItem-operationBinding like this:
Code:<operationBinding operationType="fetch" operationId="fetchCount" serverMethod="fetchCount" outputs="itemID, category"> <summaryFunctions> <itemID>count</itemID> </summaryFunctions> <groupBy> <groupByField>category</groupByField> </groupBy> </operationBinding>
- The DMI for the operationBinding is that way that it adds rows with count (=itemID) 0 for categories that are not in the result via a 2nd Select.
This is so that the SelectItem can display all categories to select from, not only those where there is a row for the current filter string. This is working fine. - Now, depending on the filtertext in the TextItem, the aggregated result differs (expected), but because of the DMI it always shows all categories, possibly with count (=itemID) 0.
- Storage of currently selected categories in the SelectItem in an own DataSource for this
- Application of these saved categories via "value: ..."
My assumption is that even though I'm setting valueField: "category" somehow the count (=itemID) field is still seen as primaryKey and having double values here causes this problem.
So I think there is a problem with the primaryKey somehow luring in the background even though I set a different valueField.
I wanted to double check with you that this setup is expected to work. If not, what am I supposed to do here?
In general an aggregation that does not include the primaryKey in the groupBy (an then it's not really an aggregation, as all primaryKeys will be different) will result in either no value for the primaryKey or possibly doubled values like in my case.
The only other solution I could imagine is having a separate DataSource for this with category as primaryKey. But that defies the idea of operationBindings a bit IMHO if I have to duplicate DataSources for every aggregation.
Best regards
Blama
Comment