0

I'm working on a ICN(3.0.4) plugin where I have created a PluginAction with name as "SampleAction". On click of this, I want open a dialog and show some options for users to select. From the services js, I'm invoking an another templated widget where I create the dialog. When this widget is called, I get an error as "ReferenceError: template is not defined". Below is the code snippet of templated widget

*************JS****************

define([
    "dojo",
    "dijit",
    "dojo/_base/declare",
    "dojo/_base/lang",
    "dijit/form/FilteringSelect",
    "dijit/form/Button",
    "dojo/store/Memory",
    "dojo/query",
    "dojo/on",
    "dojo/aspect",
    "dojo/dom-construct",
    "dojo/dom",
    "dijit/registry",
    "dojo/dom-attr",
    "ecm/model/Request",
    "ecm/model/Desktop",
    "dojo/ready",
    "dojo/NodeList-traverse",
    "dijit/ConfirmDialog",
    "dijit/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/text!./templates/SendDocsToCustomerScreen.html"
    ],
    function(dojo, dijit, declare, lang, FilteringSelect, Button, Memory, query, on, aspect, domConstruct, dom, registry, attr, Request, Desktop, ready,test,ConfirmDialog,
            _TemplatedMixin,_WidgetsInTemplateMixin,template) {

    return declare("iCNCommonServiceDojo.SendDocsToCustomerImpl", [ _TemplatedMixin, _WidgetsInTemplateMixin], {

        **contentString: template,**
        widgetsInTemplate: true,
        showDialogBox: function(repository, items, callback, teamspace, resultSet, parameterMap){
            var confirmDialog = new ConfirmDialog({
                title: "Send Documents to Customer",
                content: "Test content.",
                style: "width: 40%;height:100%;",
                buttonOk:"Send",
                buttonCancel:"Cancel"
            },"sendDocsToCustomerDialog");
            confirmDialog.set('content',this.dialogContent);
            confirmDialog.refresh();
            confirmDialog.show();
        } 

    });
});

***************HTML*********************

<div id="sendDocsToCustomer">
    <div id="sendDocsToCustomerDialog"></div>
    <div data-dojo-type="dojox.layout.TableContainer"
        data-dojo-attach-point="**dialogContent**">
            <div data-dojo-type="ecm.widget.RadioButton" data-dojo-attach-point="email" data-dojo-props="lable:'Email'"></div>
            <div data-dojo-type="ecm.widget.RadioButton" data-dojo-attach-point="fax" data-dojo-props="lable:'Fax'"></div>
        </div>
</div>
</div>

When I debug and look for the value

contentString: template

I see the error message. When plugin is loaded, I don't see any errors in console.

1
  • create constructor method and then try to console log (template) seems you have wrong url (./templates/SendDocsToCustomerScreen.html) Commented Aug 27, 2019 at 8:18

1 Answer 1

0

You're using contentString instead of templateString; ContentString is (if i'm not mistaken) used to populate dialogs.

So

 templateString: template,

Also reference: https://dojotoolkit.org/reference-guide/1.10/dijit/_TemplatedMixin.html

Not the answer you're looking for? Browse other questions tagged or ask your own question.