Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I istantiate a fragment by this code in the controller formAddElement. (i use this to pass current controller)

this._oDialog = sap.ui.xmlfragment("apps.appIntra.fragment.dialogClienti",this);

In the same controller i have a function handleSearch

handleSearch: function(oEvent) {
        var sValue = oEvent.getParameter("value");
        var oFilter = new sap.ui.model.Filter("RAG_SOC_1", sap.ui.model.FilterOperator.Contains, sValue);
        var oBinding = oEvent.getSource().getBinding("items");
        oBinding.filter([oFilter]);
  },

when in the fragment i press search the function in the controller not fire.

But if I use

this._oDialog = sap.ui.xmlfragment("apps.appIntra.fragment.dialogClienti", sap.ui.getCore().byId('formAddElement').getController());

all work!! WHY??? O_o

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
138 views
Welcome To Ask or Share your Answers For Others

1 Answer

"this" should work. you need to run F12 debugger in chrome to check what "this" is, whether it is the oController object. it could be other object depending the calling object.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...