on 10-25-2015 4:00 PM
hi
I need to create new UI5 Control that other can use via new command,my question is when I use the extend
where I should put the controller logic?
Assume that I've already control with controller logic which I want to provide out of the box when using the new control via new command....
Example will be very helpful!
~Miley
Hi Miley,
Check this sample: JS Bin - Collaborative JavaScript Debugging from which is an extended version of sap.m.Button. Where there is an extended property bgImg and method available for custom control as .getBgImg() by doing so you can fetch the URL of background image, also you can set a new URL using .setBgImg(). Is this what you are expecting?
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Take a look at the following very simple example on check box
In the controller there is a method handleCheckBoxChange ,this is proper controller method.
Assume that I want to extend this checkBox and provide this ability (handleCheckBoxChange) as part of my new control,How its recommended to do it ?I mean to embed this functionality in the new checkBox control which extend native checkBox
JS Bin - Collaborative JavaScript Debugging
Thank you,
Miley
so sorry, I provide you the wrong JSBin (embarrassing)
here it is
HI Dennis,
Lets say I need to create new UI5 control(via extend) from existing control which I've,and I want to encapsulate the control code to the new control,the control is using view code and controller code,In case I want to create the new control where should I put the code which was in the controller?there is example?
I want at the end that the user will use this control via new myCB and have minimum things to do in order to use it...How its recommended?
Thanks,
Miley
Hi Miley
Back to your original JSBin, you can create a common util class
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.