Bài đăng

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

[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: ...

Beware to use comparison and logic operator (< > =) in string in SAPUI5 control’s string

Hình ảnh
Hi there, Today I got a strange issue, which is simple, but take me a lots of time to figure out why. I used control sap.m.select, and put the text into its property like below: My page crashed because of "XML parse error"... I've found out that the character "<=" in the string of additionalText property has caused the problem. But i'm not sure what is the reason. Maybe the "<=" has special meaning in sapui5 control string. I will look up for the reason and update later. In the mean time, I've modified the string into text form so that the error can be fixed: I hope you got answer if you encounter the same issue. Anyone the root reason behind this error, please let us know. Thanks & have a nice day. Victor. ---V---