Developer forum

Forum » Development » Editor loses value in new UI

Editor loses value in new UI


Reply

I'm trying to build a very simple custom module using the Dynamicweb Editor control. I've created the MyModule custom module using the MyModule_Edit.aspx page. When adding the module to a paragraph and entering some text in the editor, this text is lost when I save the paragraph. Using the old UI solves this problem, but that's not a usable workaround. Here's my code:

MyModule_Edit.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyModule_Edit.aspx.cs" Inherits="CustomModules.MyModule_Edit" %>
<%@ Register Assembly="Dynamicweb.Controls" Namespace="Dynamicweb.Controls" TagPrefix="dw" %>
<dw:ModuleHeader ID="ModuleHeader1" runat="server" ModuleSystemName="MyModule" />
<dw:ModuleSettings ID="ModuleSettings1" ModuleSystemName="MyModule"
          Value="HelloText,Description,SampleTemplate" runat="server" />

<dw:GroupBox ID="GroupBox1" runat="server" Title="Text">
<table style="width: 100%;">
 <tr>
  <td style="width: 170px;">Text</td>
  <td><input id="HelloText" class="std" type="text" runat="server" /></td>
 </tr>
 <tr>
  <td>Long text</td>
  <td>
    <dw:Editor ID="Description" runat="server" />
  </td>
</tr>
<tr>
  <td>Template file</td>
  <td>
    <dw:FileManager ID="SampleTemplate" Folder="Templates/MyModule" runat="server" />
  </td>
</tr>

</table>
</dw:GroupBox>


MyModule_Edit.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dynamicweb;

namespace CustomModules
{
    public partial class MyModule_Edit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Properties properties = Dynamicweb.Properties.LoadProperties();

            properties.SetDefaultValue("SampleTemplate", "Template.html");
            properties.SetDefaultValue("HelloText", "Default Hello Text");
            properties.SetDefaultValue("Description", string.Empty);

            Description.Text = properties.Values["Description"].ToString();
            HelloText.Value = properties.Values["HelloText"].ToString();
            SampleTemplate.File = properties.Values["SampleTemplate"].ToString();
        }

    }
}

It looks like a bug in the control to me, but if i'm missing something here I'd be glad to know. I hope you can help me with this.


Replies

 
Nicolai Høeg Pedersen
Reply
I've investigated this further - it seems not to work in DW 7 for some reason - chaning to the old interface makes it work.

I've created a bug on this so we can have it fixed.
 
Reply
Hi,

I thought that I was the only one with this problem.
Super!

Is there a bug-number?
 
Reply
The workaround with the old interface does not work for me..
When trying to open and create a new paragraph, nothing appears..-

Windows 7
IE 8.0 build 7600 16385
 
Reply
Hi,
have you tried using properties.get_Value("Description"); instead of properties.Values["Description"].ToString(); ?

Works fine for me in DW7

//greetz Josef

 

You must be logged in to post in the forum