on 01-13-2015 8:28 PM
Hi,
I want to implement formatter for displaying a value.
I am getting errors when I use this.
<ObjectNumber number="{
path: 'Clabs',
formatter: function(value){
return value;
}
}"/>
It works fine when I do this
I am getting errors when I use this.
<ObjectNumber number="{
path: 'Clabs'
}"/>
I have set this data-sap-ui-xx-bindingSyntax="complex" in my index page too.
You can't declare javascript functions in a XMLView.
You should follow this guide to use Formatters:
https://sapui5.hana.ondemand.com/sdk/#docs/guide/482df92c6e8b429c8fc9022179515194.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
your trying to write javascript into XML
create a js formatter module outside of the XML
my.Formatter = {
formatClabs : function(sClabs){
return <logic here>
}
}
then call your formatter like
<ObjectNumber number="{
path: 'Clabs',
formatter:'my.Formatter.formatClabs'
}"/>
look at the demokit examples for reference
hth
jsp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil,
In your second case you do not need the formatter in that case do binding directly:
<ObjectNumber number="{Clabs}"/>
Hope this helps.
Regards,
Kedar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.