Developer forum

Forum » Development » Select orders for OrderList RibbonBar

Select orders for OrderList RibbonBar

Jesse Bakker
Reply

Hi,

We want to create an custom RibbonBar on the orderlist view to connect to an external webservice. See our current code below.

The button shows up fine but when clicked the orders stay empty in ribbonBtn_Click   

How can get the selected orders on button click?

[AddInTarget(RibbonBarAddInTarget.eCom.OrderList)]
public class OrderListRibbonBar : RibbonBarAddIn
{
    public OrderListRibbonBar(RibbonBar ribbon) : base(ribbon) { }

    public override void Load()
    {
        Order[] orders = base.Ribbon.DataContext.DataSource as Order[];

        RibbonBarButton ribbonBtn = new RibbonBarButton
        {
            Text = "Send",
            Icon = Dynamicweb.Core.UI.Icons.KnownIcon.ArrowCircleORight,
            Size = Icon.Size.Large,
            EnableServerClick = true,
        };
        ribbonBtn.Click += ribbonBtn_Click;

        var buttonGroup = Ribbon.CreateGroup("MyButtons", "Actions");
        buttonGroup.AddItem(ribbonBtn);
    }

    void ribbonBtn_Click(object sender, EventArgs e)
    {
        Order[] orders = base.Ribbon.DataContext.DataSource as Order[];
        //TODO: Send selected orders 
    }
}

 


Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Jesse,

There is a bug in DataContext initialization 

I registered a task to fix it #74755

Best regards,
Vladimir

 
Jesse Bakker
Reply

Hi Vladimir, 

Thanks for your feedback. Is there any time indication when this will be fixed?

And do you know if there is a workaround for this bug in the meantime?

 

 
Nicolai Pedersen
Reply

Hi Jesse

We have a release of 9.8 tomorrow which is closed for code - this bug is therefore planned for the sprint starting wednesday. This has to be fixed in the Administration package (Dynamicweb.Admin) and will therefore be released with 9.8.1.

Attached find an add-in we deliver with our Economic integration that works around the issue.

You can follow planned release number of bugs in this page: https://doc.dynamicweb.com/downloads/releases/bug-fixes/known-bugs

BR Nicolai

 

 
Jesse Bakker
Reply

Thanks Nicolai,

For now we will use with the workaround.

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Jesse

The Dynamicweb 9.8.1 release is out now.

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Daniel Hollmann
Reply

Is there any way to get all of the orders that match the filters?

Currently the orders per page, has a limit of 200, but i'm intressered in getting all the orders on all the pages that matches the filter, when an addin button is clicked.

Is that possible?

/Daniel

 
Nicolai Pedersen
Reply

Hi Daniel

Currently not... You will have to use the orderservice API and locate the orders required in that way.

BR Nicolai

 
Daniel Hollmann
Reply

Hi Nicolai.

Thanks for the answer :) 

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Daniel,

As far as I know - all orders are sent into  addIn

Just retest it on  latest DW985

 

Best regards,

Vladimir

screen.png

 

You must be logged in to post in the forum