Developer forum

Forum » Development » RibbonBar Addin

RibbonBar Addin


Reply

I'm testing the RibbonBar addin feature, and want to try to alter an Area on the Save event.

I've written the following code:

//-----------------------------------------------------------------------
// <copyright file="czTestAddin.cs" company="Corbiz">
//     All rights reserved ® Corbiz
// </copyright>
//-----------------------------------------------------------------------

namespace czTestAddin
{
    using System;
    using System.Text;
    using Dynamicweb;
    using Dynamicweb.Controls;
    using Dynamicweb.Controls.Extensibility;
    using Dynamicweb.Extensibility;


    [AddInName("TestName")]
    [AddInAuthor("Corbiz")]
    [AddInDescription("TestDescription")]
    [AddInTarget(RibbonBarAddInTarget.General.AreaEdit)]
    public class czTestAddin : RibbonBarAddIn
    {
        public czTestAddin(RibbonBar ribbon) : base(ribbon)
        {
            this.Ribbon.DataContext.Save += new EventHandler<RibbonBarDataContextEventArgs>(DataContext_Save);
        }

        void DataContext_Save(object sender, RibbonBarDataContextEventArgs e)
        {
            //Alter Area and Save
        }


        public override void Load()
        {

        }
    }
}

I can see in the documentation that it's only possible in the DataContext object extends DbObject, witch I can see the Area class does.

But the DataContext_Save function isn't called when I save.
Did i miss something i the documentation, or what is wrong?

Regards
KimS
 


Replies

 
Reply
Hi,

There was a bug with managing the data context on Area edit page (sorry about that). This bug has been fixed and the fix will be available in the nearest release.

- Pavel

 
Nicolai Høeg Pedersen
Reply
If you need it right away, I can provide a link to a build with the bug fixed. Drop me a mail if needed.
 
Thomas Larsen
Reply

I know this is an old post, but I’m having the same problem on the newest DW8 release.

 

Is there any connection?

 

You must be logged in to post in the forum