I am working on SPEAK UI in Sitecore.
I have created the button, Which is named as Edit Meta under content/webedit/ribbons/webedit
in core database. This button will be shown in Experience Editor section when I click Edit Meta button. I need to show the Data in a popup window related to that particular Meta section. I gave the command name, script file path, Access Key in button layout properties.
When i click the button in Experience Editor it shows below error.
A serious error occurred please contact the administrator
I un-commented the code which is related to SPEAK ui in sitecoreMvcExperienceEditor.config
also. I have added Sitecore.Support.122942.dll
also.
I checked the log file and it shows Could not instantiate speak request object
. Please suggest how to resolve this issue?
I followed below steps.
- I logged into
core
database using Sitecore Rocks. - I have created the Item(Meta) using strip template under
Content/Applications/Webedit/Ribbons/Webedit/
incore
database and given the Header Name and Id . - Added strip layout for Meta Item in presentation details.
- Created the Item Under Meta by using Chunk template, given HeaderName and Added Chunk layout in presentation details.
- Created another item(EditMeta) under Meta chunk using Largebutton template & given the Header name also.
- Added the LargeButton rendering for MetaData in presentation details.
- I have edited the property details of Largebutton rendering. below I mentioned the property details of Largebutton rendering.
My Js file.`
define(["sitecore", "/-/speak/v1/ExperienceEditor/ExperienceEditor.js"], function (Sitecore, ExperienceEditor)
{
Sitecore.Commands.LaunchFieldEditor =
{
canExecute: function (context) {
return true;
},
execute: function (context) {
context.currentContext.argument = context.button.viewModel.$el[0].accessKey;
ExperienceEditor.PipelinesUtil.generateRequestProcessor("ExperienceEditor.GenerateFieldEditorUrl", function (response) {
var DialogUrl = response.responseValue.value;
var dialogFeatures = "dialogHeight: 680px;dialogWidth: 520px;";
ExperienceEditor.Dialogs.showModalDialog(DialogUrl, '', dialogFeatures, null);
}).execute(context);
}
};
});
`
My class:
public class GenerateFieldEditorUrl : PipelineProcessorRequest<ItemContext>
{
public string GenerateUrl()
{
var fieldList = CreateFieldDescriptors(RequestContext.Argument);
var fieldeditorOption = new FieldEditorOptions(fieldList);
//Save item when ok button is pressed
fieldeditorOption.SaveItem = true;
return fieldeditorOption.ToUrlString().ToString();
}
private List<FieldDescriptor> CreateFieldDescriptors(string fields)
{
var fieldList = new List<FieldDescriptor>();
var fieldString = new ListString(fields);
foreach (string field in new ListString(fieldString))
fieldList.Add(new FieldDescriptor(RequestContext.Item, field));
return fieldList;
}
public override PipelineProcessorResponseValue ProcessRequest()
{
return new PipelineProcessorResponseValue
{
Value = GenerateUrl()
};
}
}
I added the reference in Sitecore.ExperienceEditor.SpeakRequest.config
<configuration>
<sitecore>
<sitecore.experienceeditor.speak.requests>
<request name="ExperienceEditor.GenerateFieldEditorUrl" type="Website.Modules.Components.ExperienceEditor.FieldEditor.GenerateFieldEditorUrl, Website.Modules" />
</sitecore.experienceeditor.speak.requests>
</sitecore>
Could you please suggest, how to fix this issue?
thanks in advance