Try our conversational search powered by Generative AI!

Create custom dojo widget that uses EPI's out-of-the-box link editor


I have a custom dojo widget that displays a list of custom tags assigned to a page. When a user clicks a tag, I want to open a dialog box that shows the "create link" dialog.

Here's the code that I'm using to do that:

this.dialogContent = new LinkEditor({ });

this.isShowingChildDialog = true;

this.dialog = new Dialog({
                        title: "Select a page",
                        dialogClass: "epi-dialog-portrait",
                        content: this.dialogContent,
                        destroyOnHide: true

I can get the dialog box to come up correctly when I add static text to the "content" parameter, but it breaks with a console error when I try it like the above. The error that I get is that it "can't read properties of null." I'm thinking that LinkEditor needs to be preloaded with some parameters to fix this error. What are these parameters?

Mar 09, 2017 20:04

Hi Tevin

You could try something like this:

this.dialogContent = new LinkEditor({
    modelType: this.metadata.additionalValues["modelType"],
    hiddenFields: ["text", "title", "target", "language"]

Don't forget this.own(this.dialogContent); before creating the dialog.

Mar 20, 2017 0:14

Thanks, David!

I'm getting a console error of "cannot read property 'additionalValues' of undefined when I try that. Do I need to add something somewhere else in order to get it to work?

Mar 20, 2017 13:43

Hi Tevin

I tried this in debug and you can try using:

''    << quotes included

instead of 



Mar 20, 2017 14:49
James Wilkinson - Nov 27, 2019 17:16
This was a massive help for me today thanks David! I couldn't see anywhere this was documented, might be worth blogging it ;)
David Knipe - Nov 27, 2019 17:44
Ha its remarkable as I don't even remember answering this ;)! We always welcome and encourage and new bloggers if you fancied it Jay?

Awesome, thank you! That worked.

Mar 20, 2017 17:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.