on 2020 Nov 08 10:04 PM
Hello All,
There are 2 similar issues.
1) In MultiInput, I set Tokens and Open the Value Help Dialog. I can see the tokens are properly set on value help dialog, but rows are not shown as selected.
2) I open Value Help Dialog, then select rows from inital list. Then I perform search on the value help. Rows selected are gone or not shown. But still previously selected tokens can be seen in the Value Help Dialog.
I have used the code as per sample form SAPUI5, I am unable to see any difference other that I am binding the OData model and Sample is binding the JSON Model.
SAPUI5 Version is 1.71.21
Any help is highly appreciated. Please let me know if you need more information from my side.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is the position for the Update Call! Is it fine? Or I need to insert Update some place else.
// When Value Help is Requested
onSupplierHelpRequested: function() {
var aCols = this.oSupplierColModel.getData().cols;
this._oReferenceBasicSearchField = new SearchField({
showSearchButton: false
});
this._oSupplierHelpDialog = sap.ui.xmlfragment("Reference.view.fragment.supplierHelp", this);
this.getView().addDependent(this._oSupplierHelpDialog);
this._oSupplierHelpDialog.setRangeKeyFields([{
label: "Supplier",
key: "Supplier",
type: "string",
typeInstance: new typeString({}, {
maxLength: 7
})
}]);
var oFilterBar = this._oSupplierHelpDialog.getFilterBar();
oFilterBar.setFilterBarExpanded(false);
this._oSupplierHelpDialog.getTableAsync().then(function (oTable) {
oTable.setModel(this.oDefaultModel);
oTable.setModel(this.oSupplierColModel, "columns");
if (oTable.bindRows) {
oTable.bindAggregation("rows", "/SupplierInfoSet");
}
if (oTable.bindItems) {
oTable.bindAggregation("items", "/SupplierInfoSet", function () {
return new ColumnListItem({
cells: aCols.map(function (column) {
return new Label({ text: "{" + column.template + "}" });
})
});
});
}
this._oSupplierHelpDialog.update();
}.bind(this));
this._oSupplierHelpDialog.setTokens(this._oSupplierInput.getTokens());
this._oSupplierHelpDialog.open();
}
// When Search is Performed on Value Help
_filterTable: function (oFilter, oValueHelp) {
var oValueHelpDialog = oValueHelp;
oValueHelpDialog.getTableAsync().then(function (oTable) {
if (oTable.bindRows) {
oTable.getBinding("rows").filter(oFilter);
}
if (oTable.bindItems) {
oTable.getBinding("items").filter(oFilter);
}
oValueHelpDialog.update();
});
}
Hi
I didn't many experiments with this problem. As I understood a data request is triggered by open method. I didn't find events in ValueHelp control to track data request complete so I did it on model's level. I used code like this
this.getView().getModel().attachRequestCompleted(function (oEvent) {
if (oEvent.getParameter("url").startsWith("<EntitySetId>")) {
//console.log("requestCompletedForNotificationSet");
this._oValueHelpDialog.update();
}
}.bind(this));
sap.dev.sam Great! 🙂 It worked like a charm. You are saviour. mioyasutake For your reference.
User | Count |
---|---|
57 | |
11 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.