Bài đăng

Hiển thị các bài đăng có nhãn fragment

[sapui5] [list] [fragment] Fragment/Dialog binding not working

Hình ảnh
Possible reason: You haven't set model to that dialog/fragment. This is because of the ui5 framework concept: A new fragment will have its own model. If you want that fragment has the same model as the view. Please use the below command line: this.getView().addDependent(this.oPictureDialog); ---V---

[sapui5] Always remember to pass controller object when initiate fragment

Hình ảnh
Hi, I've got painful days searching to get this error. Here's the problem: Problem I can not get any event in above table. When I press the button, it does not trigger the function in the controller. I don't know why... until today. UI design Reason The problem comes from my initiation of the fragment to be used as table items. Each fragment to have a controller, but my code make the fragment get the wrong controller, Instead of getting controller of that view, they misunderstood with the window object, because I initiate the fragment where the context of this is the window object: The code in the browser console It's good to init your controller's properties in the top to provide an overview of global properties. But be aware of this keyword, which is very dynamic in Javascript. Solution If you init fragment to use in the view, init it in the event onInit() of view is the best, which the controller already loaded into this  key word: ...