sapui5 pass parameter to value help dialog of smartFilterBar ControlConfiguration

隐身守侯 提交于 2019-12-25 08:58:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!