Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lars Hundebøl 3 posts 23 karma points
    Dec 09, 2010 @ 08:19
    Lars Hundebøl
    0

    Is there a problem with AbstractDataEditor in Umbraco 4.5.2?

    Hi all,

    I've developed my very first custom data type by implementing the AbstractDataEditor, but it doesn't seem to be working. I've modeled my data type using the example by Tim G, and looks something similar to this:

      public class ModulesDataType : AbstractDataEditor  {
        TextBox _control = new TextBox();
        public override Guid Id
        {
          get
          {
            return new Guid("89a4118b-d129-4f8f-ae75-a3d23c2abcc1");
          }
        }

        public override string DataTypeName
        {
          get
          {
            return "Test";
          }
        }
        public ModulesDataType()
        {
          base.RenderControl = _control;
          _control.Init += new EventHandler(_control_Init);
          base.DataEditorControl.OnSave += new AbstractDataEditorControl.SaveEventHandler(DataEditorControl_OnSave);
          
        }

        void DataEditorControl_OnSave(EventArgs e)
        {
          base.Data.Value = _control.Text;
        }

        void _control_Init(object sender, EventArgs e)
        {
          _control.Text = base.Data.Value != null ? base.Data.Value.ToString() : "";
        }
      }

     

    What is wrong with the code above? Is there a bug in Umbraco 4.5.2 with AbstractDataEditor?

  • Lars Hundebøl 3 posts 23 karma points
    Dec 09, 2010 @ 09:20
    Lars Hundebøl
    0

    I would really like to edit the text above, but it is currently not possible.

  • Lars Hundebøl 3 posts 23 karma points
    Dec 09, 2010 @ 13:06
    Lars Hundebøl
    0

    My bad. My problem was not at all related to the code described above, but was purely a misconfigured umbraco environment.

Please Sign in or register to post replies

Write your reply to:

Draft