+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Pls. Help: Creating the new library workflow in a custom modal dialog

Pls. Help: Creating the new library workflow in a custom modal dialog

2 posts, 0 answered
  1. Paul
    Paul avatar
    2 posts
    Registered:
    19 Dec 2011
    20 Dec 2011
    Link to this post
    Hi.

    The client has asked me to do a mod to the Create News Item form. He wants the "create a library" UI available as a pop-up window next to the libraries drop down.

    So, I have added a custom button selector next to it:

    <sfLib:ButtonSelector ID="ButtonSelector2" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/GalleryTestDialog.aspx?module=Libraries&route=LibrariesControlPanel.LibrariesView.LibraryNew`1"
                                ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/NewGalleryButton.ascx"
                                AssociatedControls="GalleryID" runat="server" CssClass="pickerWrapper" ButtonText="Create" />

    After I go through the library creation process, I post-back the page so the selector updates.

     function OnGalleryClose(sender, eventArgs) {
            // just postback the drop down list control
            __doPostBack("GalPickUpdatePanel","");

        }

    THE PROBLEM I AM HAVING is two-fold:

    1) It isn't clear to me how to access the ParentId guid to get the library I just created so I parse the action attribute of the form tag of the new window on the page using javascript:

    <form id="form1" action="/en-US/Sitefinity/UserControls/Dialogs/GalleryTestDialog.aspx?module=Libraries&amp;route=LibrariesControlPanel.LibraryItemsView.LibraryItemList&amp;ParentId=c8889779-390f-40dc-b380-f6721c87f02e" method="post" name="form1">

    2) The second problem I am having is how to update the html of the parent page such that the DDL of libraries shows the library name just created once the page post-backs.

    It seems to me that I am brute-forcing this and there should be a more elegant way to create this modal window and update the libraries DDL.

    Ideas? Suggestions? Help?
  2. Paul
    Paul avatar
    2 posts
    Registered:
    19 Dec 2011
    20 Dec 2011
    Link to this post
    anybody have a suggestion or need more clarification? I really need a solve in the next few hours...
    Thanks.
2 posts, 0 answered