Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1431 posts 3332 karma points c-trib
    Mar 22, 2010 @ 23:08
    Simon Dingley
    1

    How do I add a save button to the control strip in a custom section/tree?

    I have a custom section and tree with no buttons on the tab toolstrips - how do I add one and hook into the save event?

  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Mar 22, 2010 @ 23:18
    Paul Sterling
    1

    Simon -

    Here's a snippet from the Commerce for Umbraco Admin section (Coupons in this case).

    //  OnInit...
                //Add Save button
                ImageButton button = this.Panel1.Menu.NewImageButton();
                button.Click += new ImageClickEventHandler(this.save_click);
                button.AlternateText = "Save";
                button.ImageUrl = GlobalSettings.Path + "/images/editor/save.gif";
    ...
            private void save_click(object sender, ImageClickEventArgs e)
            {
                 // SaveCoupon does the actual save 
                if (this.SaveCoupon(base.Request.QueryString["c"]))
                {
                    base.speechBubble(0, ui.Text("speechBubbles", "commerceItemSaved"), "");
                }
                else
                {
                    base.speechBubble(0, ui.Text("speechBubbles", "commerceItemErrorHeader"), ui.Text("speechBubbles", "commerceItemErrorText"));
                }
            }

     

    -Paul

     

  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Mar 22, 2010 @ 23:20
    Paul Sterling
    1

    ...sorry about the formatting, not sure what happned...

    Also, here is the markup shopwing 'Panel1' from above:

        <cc1:UmbracoPanel ID="Panel1" runat="server" Width="608px" Height="636px" hasMenu="true">
          <cc1:Pane ID="Pane7" runat="server" Height="600px" Width="530px">
            <cc1:PropertyPanel runat="server" ID="pp_couponcode">
                  <asp:TextBox ID="CouponCode" runat="server" Width="300" CssClass="guiInputText" Enabled="false"></asp:TextBox>
            </cc1:PropertyPanel>

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies