on 01-13-2015 5:49 AM
Hi,
I want to display data in an icon which appear in table cell with data counter. Please share sample code/recommendations to achieve requirement.Do we need custom controls for this or any standard UI available?
If custom control is needed , Please recommend me project structure for best practices to implement in xml view approach.
Regards,
Koti Reddy
What do you mean with display data in an icon?
Show a subtitel below it or what?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using custom controls in XML views is actually not much different than using custom controls in JS views.
You create your custom control just as you normally would:
(function () {
"use strict";
jQuery.sap.declare("com.biz.app.customcontrols.MyCustomControl");
jQuery.sap.require("sap.m.<whatevercontrolyouneed>");
sap.ui.core.Control.extend('com.biz.app.customcontrols.MyCustomControl', {
metadata : {
properties : {
someProperty : { type : "string"}
}
},
init : function() {},
onAfterRendering : function() {},
renderer : function() {},
_someCustomPrivateMethod : function() {},
someOtherCustomMethod : function() {}
});
}());
and store it in a folder in your project (if your local root resolves to "com.biz.app", then make a subfolder "customcontrols" where you store the file MyCustomControl.js")
Then, in your XML view, you would reference your control using it's namespace:
<mvc:View
controllerName="com.biz.app.MyView"
xmlns:mvc="sap.ui.core.mvc"
xmlns:core="sap.ui.core"
xmlns="sap.m"
xmlns:custom="com.biz.app.customcontrols">
<custom:MyCustomControl someProperty="{/modelProperty}" />
</mvc:View>
Hope this explains it well!
R.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.