问题
I have SmartFilterBar on my page based on oData service. One of filterable fields has value help dialog. When value help dialog opened i need to fill one of search parameters in this value help dialog. How can i do this? I can't get value help dialog by control because "byId() method" i don't now id of created dialog.
回答1:
I found the solution: how can I get id of opened valuehelpdialog: In the event "onValueHelpRequest" of I redigine "onAfterRendering" method of class "sap.ui.comp.valuehelpdialog.ValueHelpDialog" and in this method I can get the id of the dialog:
filterInitialize: function() {
var oDogovorControl = this.getView().byId("smartFilterBar").getControlByKey("Dogovor");
oDogovorControl.attachValueHelpRequest(this.onValueHelpRequest, this);
},
onValueHelpRequest: function() {
sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.test = sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.onAfterRendering;
var fntest2 = function(oEvent){
this.test();
console.log(this.getId());
};
sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.onAfterRendering = fntest2;
}
来源:https://stackoverflow.com/questions/46995384/sapui5-pass-parameter-to-value-help-dialog-of-smartfilterbar-controlconfiguratio