cancel
Showing results for 
Search instead for 
Did you mean: 

Need to show total task number in Inbox like previous UWL

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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>

kedarT
Active Contributor
0 Kudos

Hi Ragavendran,

How about using the event - oDataRequestCompleted for sap.uiext.inbox.Inbox and then use the oControlEvent.getParameters to get the count of entries.

All the best with this.

Regards,

Kedar

Former Member
0 Kudos

Hi kedar,

Thanks.

I have used the method you mentioned.. kindly go through the code above.

i am trying to understand what is difference between oEvent.mParameters and oControlEvent.getParameters

Thanks,

Ragav

kedarT
Active Contributor
0 Kudos

Hi Ragav,

I think both oEvent and oControlEvent are same and would give you the instance of the Event.

oEvent.mParameters is referring to the attributes of the instance and getParameters would give the value of the attribute of the instance.

Regards,

Kedar

ChandraMahajan
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks for the prompt answer!!!

I would like to download inbox-1.8.4-opt.jar from where i can do it? if u have kindly share

Former Member
0 Kudos

Hi Raghvendran,

Can you help with the jar file?

Were you able to download it from somewhere?

Regards,

Deep