Skip to Content

We can add static values in a XML View by defining the static data in i18n properties file.

in i18n.properties file add the below line

Notifications=Notifications

In XML View add similar code like this:

count=”{parts:[‘NotificationCount’,’i18n>Notifications’],formatter:’.formatter.hideZeroCount’}”

 

Note: ‘NotificationCount’ comes from oData model and i18n>Notifications is the static text from i18n.

You could access both values in formatter as below

 

hideZeroCount:function(count,id) {

if(id==”Notifications”) {

if(count==0) {

return null;

} else {

return count;

}

}

},

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply