Try our conversational search powered by Generative AI!

Update value on a Editor on page

Vote:
 

We have in our project used some editors on pages. So far we have used them and they have done what we needed until now.

We are basicly using this codes.

<EPiServer:Property PropertyName="MyLongStringProperty" id="HtmlEditor" EditMode="true" runat="server" />

Init function()
{Page.ClientScript.RegisterClientScriptInclude("system.js", ((PageBase)Page).ResolveUrlFromUI("javascript/system.js")); Page.ClientScript.RegisterClientScriptInclude("system.aspx", ((PageBase)Page).ResolveUrlFromUI("javascript/system.aspx")); Page.ClientScript.RegisterClientScriptInclude("episerverscriptmanager.js", ((PageBase)Page).ResolveUrlFromUtil("javascript/EPiServerScriptManager.js")); PropertyXhtmlString xhtmlString = new PropertyXhtmlString(); // select chosen options or use EditorToolOption.All // EditorToolOption.Bold | EditorToolOption.Italic | EditorToolOption.Underline; xhtmlString.EditorToolOptions = EditorToolOption.All; xhtmlString.Name = "MyLongStringProperty"; HtmlEditor.InnerProperty = xhtmlString;
}

    

public string Value
        {
            get
            {
                ((PageBase)Page).SetValuesForPropertyControls(HtmlEditor);
                return HtmlEditor.PropertyValue as string;
            }
            set
            {
                ((PageBase)Page).SetValuesForPropertyControls(HtmlEditor);
                HtmlEditor.InnerProperty.Value = value;
            }
        }

So when i load the page i have no value on the editor, and when i then select something in a drop down i load data from database and set the value and the edit loads with the new data. However after that it's like the data in the editor ish cached somehow.((PageBase)Page).SetValuesForPropertyControls(HtmlEditor); <- automaticly loads the first loaded value (from drop down/database).
But then the value is changed by the code and i can confirm it with VS debug, but the editor it self dont update it still shows the old (first) value.

I have tried many different things like "HtmlEditor.InnerProperty.LoadData(value);" and "HtmlEditor.InnerProperty.Clear();" first even, but nothing seems to help.

Anyone got some kind of ideas here ?
As posted in the CMS6 R2 Forum , we do run the newly CMS6 R2 as episerver.

 

#50272
Apr 21, 2011 10:19
Ted
Vote:
 

If you just want to use TinyMCE I'd recommend using the actual EPiServer.Editor.TinyMCE.Editor control. We've created an inherited version of that control to set PropertySettings (for toolbars etc) in the constructor.

That way you'll just get/set the value through the Text property. :)

#50316
Apr 27, 2011 11:06
Vote:
 

Ted

How did you implement the TinyMCE editor, we tried the section "Using the TinyMCE Web Control" on http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/TinyMCE-Developers-Guide/
but we only get a NullRefrenceError.

Does your implementation of TinyMCE have "connection" to EPiServer on advImage and advLink (ie you can add images that is saved in EPiServer filemanager)?

#50421
May 02, 2011 7:50
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.