$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

sap/ui/demo/wt/controller/HelloDialog - Unable to comprehend

Hi Experts,

The tutorial code for "Resue Dialogs" is too hard for me to understand.

Just a bit of inslight would make my life easier.

How is "

sap/ui/demo/wt/controller/HelloDialog" this been added in component.js when sap/ui/demo isn't a library ( or namespace) in the standard?

Further there is one more code -

What is oView here and what reference is it pointing to?

Much appreciated . Thanks, D

sap.ui.define(["sap/ui/base/Object"],function(UI5Object){"use strict";return UI5Object.extend("sap.ui.demo.wt.controller.HelloDialog",{constructor:function(oView){this._oView = oView;},
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 19, 2017 at 03:42 PM

    Hello D,

    This is because of a concept called resource-roots . The webapp folder is always the root folder your application. If you check your index.html you will see that there is property called sap-ui-resourceroots and it points "./" for sap.ui.demo.wt . As a result whenever you encounter sap.ui.demo.wt it means that this an alias for webapp folder of your application(this is also alternatively called as namespace) . As a result to look for HelloDialog it is looking HelloDialog.js file in path sap.ui.demo.wt.controller which means inside the controller folder inside the webapp folder. Similarly this can also be maintained in manifest.json for launchpad specific applications.

    Hope this helps.

    Thanks and Regards,

    Veera

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Devashish,

      If you have followed the Walkthrough step in Step4-XML Views the namespace is defined.

      sap.ui.define(["sap/ui/base/Object"],function(UI5Object){"use strict";return UI5Object.extend("sap.ui.demo.wt.controller.HelloDialog",{

      The above line is registering the module and any reference to sap.ui.demo.wt.controller.HelloDialog would be resolved to the above js file.

      In case your question is answered mark the answer suitably.

      Thanks and Regards,

      Veera

  • Apr 19, 2017 at 12:40 PM

    sap/ui/demo/wt this is the namespace. check your index.html(usually)

    oView is the input parameter, when you instantiate the dialog, you will supply this.

    just check the code where the dialog instance is created. you will get it.

    Add comment
    10|10000 characters needed characters exceeded