November Happy Hour will be moved to Thursday December 5th.

How to show the image selector in Dojo

Vote:
 

I'm trying to make a custom single image selector control. In this control I want to be able to select an image from EPiServer or from another specified source.
It is too bad I had to create the control from scratch; I'd like to be able to just extend the existing control. This means I cannot drag and drop the image into the field; I have to select it.

But it is acceptable and it almost works. I can change the URL by selecting an image from my 'other specified source', but I cannot select an image from EPiServer...
I've have the following code which is run 'onclick' of the EPiServer select image button:

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

   this.own(this.dialogContent);

   return new Dialog({
      title: "Select media",
      dialogClass: "epi-dialog-portrait",
      content: this.dialogContent,
      destroyOnHide: false,
      defaultActionsVisible: false
   });
}

Problem is: this.metadata.additionalValues["modelType"] is null... And I have no idea what value to put there to get the image picker dialog; I've tried about everything I could think of.
When I click the button, the first time nothing happens, and the second time an empty dialog is shown.

How can I get the imagepicker to show?

#116176
Jan 26, 2015 10:48
Vote:
 

Can anyone help me with this?

Or is there another way to extend the select image editor with a custom source selection button?

#116366
Jan 29, 2015 9:51
* 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.