on 01-08-2015 6:45 AM
Hi Gurus,
Custom inbox has been developed similar to BPM inbox using UI5 toolkit.
Here a new requirement is that, to display the total number of task in the box i.e., task count.
I have a piece of sample code to do this functionality , but one doubt in that code snippet is
var url = "/databinding/proxy/http/host:port/.........";
above mentioned line is that default one to get the count or what URL i am supposed to add in that.
Step by step docs or lonk also appreciated.
Thanks,
Ragav
Hi gurus,
I have written following piece of code in index.html... but desire output is not proper, please help out on this code ..
var oLabel = new sap.ui.commons.Label({id : "inboxTaskCount"});
var url = ""; // proper url has in placed here.
var oModel = new sap.ui.model.odata.ODataModel(url, true);
oModel.setCountSupported(false);
//creating instance of inbox
var inx = new sap.uiext.inbox.Inbox();
inx.setHandleBindings(true);
inx.setModel(oModel);
inx.bindTaskTable("/TaskCollection");
//Code to get the Task Count
inx.attachODataRequestCompleted(function(oEvent){
var label = sap.ui.getCore().byId("inboxTaskCount");
label.setText("Task Count ( "+oEvent.mParameters.bindingLength+ " )");
label.setDesign(sap.ui.commons.LabelDesign.Bold);
});
oLabel.placeAt('taskcountcontent');
var oLabel1 = new sap.ui.commons.Label({id : "inboxTaskCount1"});
var label1 = sap.ui.getCore().byId("inboxTaskCount1");
label1.setText("Task Count ( )");
oLabel1.placeAt('taskcountcontent1');
</script>
</head>
<body class="sapUiBody" role="application">
<div id="ajaxloader" style="display:none;"></div>
<div id="taskcountcontent">Task Count : </div>
<div id="taskcountcontent1">Task Count 1 : </div>
<div id="content"></div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use $count to get the number of records from entityset (or collection) for e.g. http://services.odata.org/OData/OData.svc/Categories/$count
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.