Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Note Taker Control

Hi all,

I am trying to develop a Note Taker control in eclipse but facing  some issues..Please check my code and let me know where I am mistaking

Refer to the code..As I am using Math functions ..Do I need to include anything in model (index.html)

View :

createContent : function(oController) { 

           

             //Create a Note Taker

            var noteTaker1 = new sap.ui.commons.NoteTaker({

                  id : "NT1" ,

                  visibleNotes : 3 ,

                  attachmentUploadUrl : "../../../../../upload"

            });

            noteTaker1.attachmentSelect(oController.attachFunc);

            noteTaker1.attachmentUploadComplete(oController.attachUpload);

            noteTaker1.attachmentDelete(oController.deleteFunc);

            noteTaker1.attachmentClick(oController.attachClick);

           

            //Create a Note Taker Card which you have attach to the Note Taker

            var oCard = new sap.ui.commons.NoteTakerCard({

                  id : "NT1_NTC1" ,

                  uid : Math.floor((Math.random()*1000)+1) ,

                  header : "New Contract Signed" ,

                  body : "Client has signed the new contract to us.If you have any queries please contact queries@sap.com" ,

                  thumbDown : true , //Indicates negative information for a new card

                  tags : ["new_contract" , "queries"]

            });

            //Add card to Note Taker

            noteTaker1.addcard(oCard);

           

            //Create another card

            oCard = new sap.ui.commons.NoteTakerCard({

                  id : "NT1_NTC2",

                  uid : Math.floor((Math.random()*1000)+1) ,

                  header : "I am not satisfied with your service " ,

                  body : "The customer care service is not at all good. They do not respond properly. They talk to customers in a harsh way.No proper service is provided . They don resolve our problems . they cut the call in middle . Poor customer Service . Better you change this process and join new employees who can work good . otherwise your market value will be decreased . completed the Lean course nearly 2 months back but getting the mails continuously to complete.  I have been raising tickets on this issue from then but no resolution.I have contacted MQ Academy also.I am forwarding that mail to you. Please check . one ticket , they closed like You did not pass the Lean Assessment. Link will be enabled after 4 weeks to attempt. It's been many days but in my QuestionMark page only ITIL assessment is enabled though I cleared it.I am ready to attempt it again but It is not showing in QuestionMark Perception.Request you to find a resolution to my problem." ,

                  thumbDown : true ,

                  tags : ["customer_care" , "Poor"],

                  attachFileName : "attachment.pdf"

            });

             //Add card to Note taker

            noteTaker1.addCard(oCard);

           

            //Create another card

            oCard = new sap.ui.commons.NoteTakerCard({

                  id : "NT1_NTC3",

                  uid : Math.floor((Math.random()*1000)+1) ,

                  header : "Employee Requirement" ,

                  body : "Requirements : Good communication skills , Pleasing nature to convince customers" ,

                thumbDown : true ,

                tags : ["Requirement" , "Employee"]

            });

           

            //Add card to note taker

            noteTaker1.addcard(oCard);

           

              return noteTaker1;

      }


Controller :

sap.ui.controller("individual.view", {

  //Function to handle the select event of the items

  attachFunc : function(e) {

  jQuery.sap.log.info("NTF:Attachment was selected - " + e.getParameter("filename"));

  this.setNextCardUid("Card - " + Math.floor((Math.random()*1000)+1));

  this.uploadAttachment();

},

attachUpload : function(e) {

  jQuery.sap.log.info("NTF:Attachment was uploaded - " + e.getParameter("response") + "Uid" + e.getParameter("Uid"));

},

deleteFunc : function(e) {

   alert("AttachmentDelete.Attachment - " + e.getParameter("filename") + "Card Uid" + e.getParameter("Uid"));

},

attachClick : function(e) {

   alert("AttachmentClick.Attachment - " + e.getParameter("filename") + "Card Uid" + e.getParameter("Uid"));

}

});

index.html

<!DOCTYPE HTML>

<html>

  <head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>

  <script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.ui.commons"

  data-sap-ui-theme="sap_bluecrystal">

  </script>

  <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->

  <script>

  sap.ui.localResources("individual");

  var view = sap.ui.view({id:"idview1", viewName:"individual.view", type:sap.ui.core.mvc.ViewType.JS});

  view.placeAt("content");

  </script>

  </head>

  <body class="sapUiBody" role="application">

  <div id="content"></div>

  </body>

</html>

replied

Hi Sindhu,


  • From your code, I see sap.ui.commons.NoteTaker, where sap.ui.commons doesn't have NoteTaker control.
  • sap.suite.ui.commons library has NoteTaker control. So you have to use the same library for NoteTaker.

     JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.suite.ui.commons.NoteTaker

  • And whenever you're using events with control. Then you have to provide function to that event. In your code,  it is mentioned as noteTaker1.attachmentSelect(oController.attachFunc); which is wrong, it should be

    

noteTaker1.attachAttachmentSelect(function(oEvent){

oController.attachFunc;

});

  • Same for all the events.

Please check the sample here - http://plnkr.co/edit/dd8mmqjm0XCZ8FbwlGbS?p=preview

Regards,

Sai Vellanki.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question