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

Forums / Developing with Sitefinity / Selection of Mulitple Images

Selection of Mulitple Images

14 posts, 0 answered
  1. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    01 Jul 2010
    Link to this post
    Hi Team Telerik,

    I need to develop a control with a listview on frontend having images from a sf image library or images. What I have seen and done so far is that I've used the I need to develop a control with a listview on frontend having images from a sf image library or images. What I have seen and done so far is that I've used the
    [WebEditor("Telerik.Libraries.WebControls.ImageSelector, Telerik.Libraries")]
    for my control to select images, but it provides me with the selection of a single image only, what I need is to select the whole library or multiple images from that library/folder, some sort of list that i would bind to my listview.

    What I have in my mind are different solutions.

    1 - To have a built in sf code snippet that would allow me to select multiple images or a whole library, that would somehow able to be bounded with listview.

    2 - Something like the functionality of adding tags, instead of tags i'll be adding images (Would I need to store that data to db too? As i want this to act like an advance property of my control)

    TIA,

    Nauman
  2. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    01 Jul 2010
    Link to this post
    BTW, I'm not using image library coz those images will have hyperlinks too, and I want them to be displayed in a total different layout than what sf image library provides.

    Regards,

    Nauman
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 Jul 2010
    Link to this post
    Hello Nauman,

    1 - To have a built in sf code snippet that would allow me to select multiple images or a whole library, that would somehow able to be bounded with listview.


    You have to create a WebUITypeEditor

    Something like the functionality of adding tags, instead of tags i'll be adding images (Would I need to store that data to db too? As i want this to act like an advance property of my control)

    Please elaborate some more about how these "tags" will act and what is the purpose of them, so I could provide proper information.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    01 Jul 2010
    Link to this post
    Hi Ivan,

    About tags, i was just putting an example here, actually the end result should be that for my listview i'll need a datasource of images with hyperlinks. So what i've guessed so far is that you're absolutely right I need to write down a WebUITypeEditor.

    I'll write down a WebUITypeEditor that'll return a list of images and corresponding hyperlinks, it'll be utilizing ImageSelector and CmsUrlWebEditor. But the problem is what approach should I use to put down images and links in list. I remember going through a post where somebody of your team used such an approach to put down multiple data in a list, but have lost it. :-(

    TIA,

    Nauman



  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 Jul 2010
    Link to this post
    Hello Nauman,

    Most probably you need generic list List<T> or Dictionary<TKey, TValue>

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    01 Jul 2010
    Link to this post
    Thanks Ivan for guiding me to dictionary<key,value> it eventually led me here, I believe all I need to do now is to use this and then may be post here again if I get stuck :)

    Thanks again,

    Nauman
  7. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    02 Jul 2010
    Link to this post
    Hi Ivan,

    I have used the example from here, have made some changes to it, please have a look at attached images, in the WebUITypeEditor-ImageSelector.jpg you can see that the image selector control is being displayed on the back of WebUITypeEditor template control, I want it to be on front so that I can select an image.

    Waiting for your reply,

    Nauman

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    02 Jul 2010
    Link to this post
    Hi Nauman,

    You could create a Control Designer which will display the property on the Basic level of the control - right away when you open it for editing. Or create PropertyEditorDialog which will work on your pages.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    02 Jul 2010
    Link to this post
    Hi Ivan,

    I'm totally disappointed in myself, as I'm not able to work this out, all I need is a control that presents a listview containing images enclosed in hyperlinks with properties for admin to add as many images and associated hyperlinks as possible, but ended up writing down and copying a lot of codes, using WebUITypeEditor, ControlDesigner and everything.

    Can't it be simplified that somehow I can write down a simple control that presents a listview of hyperlinked images with properties for admin to choose from sitefinity image and page selectors :'(

    Regards,

    Nauman
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Jul 2010
    Link to this post
    Hi Nauman,

    The only way to have multiple links and images is using TypeEditors and creating a complex properties. Another option is creating several predefined properties ( say 10) and use them to enter the links/images via WebUIType Editor.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    05 Jul 2010
    Link to this post
    Hi Ivan,

    Well as I was running off my time-lines so eventually ended up with the solution of having multiple properties for links and images, although its not that sleek solution.

    Thanks for the support,

    Nauman
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Jul 2010
    Link to this post
    Hi Nauman,

    You can have your image selector selecting multiple images and returning them or their IDs using comma separated values. Thins in an approach similar to the one in this blog post.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    05 Jul 2010
    Link to this post
    Thanks Ivan,

    I'll look into this, but can I ask you a question that isn't related to current topic at all ?

    Regards,

    Nauman
  14. Nauman
    Nauman avatar
    23 posts
    Registered:
    02 Jun 2010
    06 Jul 2010
    Link to this post
    Hi Ivan,

    For my backend I've a listveiw control as following:

    <telerik:RadListView ID="rlvBanners" runat="server" DataKeyNames="ProductBannerId"
        OnItemCommand="rlvBanners_ItemCommand" DataSourceID="sdsBanners" ItemPlaceholderID="phBanners"
        Skin="WebBlue">
        <EmptyDataTemplate>
            No Banner added yet.
            <asp:LinkButton ID="btnInitInsert" runat="server" Text="" OnClick="btnBannerInitInsert_Click"
                CssClass="CmsButLeft new"><strong class="CmsButRight light">Add new Banner</strong></asp:LinkButton>
        </EmptyDataTemplate>
        <LayoutTemplate>
            <asp:Panel ID="BannerPanel" runat="server">
                <div class="Swatches">
                    <div class="swatch">
                        <asp:PlaceHolder ID="phBanners" runat="server"></asp:PlaceHolder>
                    </div>
                    <br />
                    <br />
                    <asp:LinkButton ID="btnInitInsert" runat="server" Text="" OnClick="btnBannerInitInsert_Click"
                        CssClass="CmsButLeft new"><strong class="CmsButRight light">Add new Banner</strong></asp:LinkButton>
                </div>
            </asp:Panel>
        </LayoutTemplate>
        <ItemTemplate>
            <div class="Bannercategory">
                <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" ImageUrl='<%# GetItemUrl(Eval("BannerURL").ToString()) %>'
                    AlternateText='' ResizeMode="Fit" Height="78px" />
                <p class="button_area">
                    <asp:LinkButton ID="btnEdit" runat="server" Text=" " CommandName="Edit" CssClass="CmsButLeft editdark"><strong class="CmsButRight dark">Change Banner</strong></asp:LinkButton>
                </p>
            </div>
        </ItemTemplate>
        <EditItemTemplate>
            <fieldset class="ProdSet">
                <asp:TextBox ID="txtBanner" Text='<%# Bind("BannerURL") %>' runat="server" MaxLength="250"
                    Width="80%"></asp:TextBox>
                <sfLib:ButtonSelector ID="bsBannerThumb" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"
                    ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx"
                    AssociatedControls="txtBanner" runat="server" CssClass="picker" ButtonText="Select" />
                <p class="button_area">
                    <asp:LinkButton ID="btnUpdate" runat="server" Text=" " CommandName="Update" CssClass="CmsButLeft okdark"
                        ValidationGroup="BannerEditor"><strong class="CmsButRight dark">Save</strong></asp:LinkButton>
                    <span>or</span>
                    <asp:LinkButton ID="BtnCancel" runat="server" Text=" " CommandName="Cancel" CausesValidation="false"
                        CssClass="CmsButLeft dark"><strong class="CmsButRight dark">Cancel</strong></asp:LinkButton>
                </p>
            </fieldset>
        </EditItemTemplate>
        <InsertItemTemplate>
            <br />
            <br />
            <fieldset class="ProdSet">
                <asp:TextBox ID="txtBanner" Text='<%# Bind("BannerURL") %>' runat="server" MaxLength="250"
                    Width="80%"></asp:TextBox>
                <sfLib:ButtonSelector ID="bsBannerThumb" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"
                    ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx"
                    AssociatedControls="txtBanner" runat="server" CssClass="picker" ButtonText="Select" />
                <p class="button_area">
                    <asp:LinkButton ID="btnPerformInsert" runat="server" Text="Save Banner" CommandName="PerformInsert"
                        CssClass="CmsButLeft okdark" ValidationGroup="BannerInsert"><strong class="CmsButRight dark">Save</strong></asp:LinkButton>
                    <span>or</span>
                    <asp:LinkButton ID="BtnCancelI" runat="server" Text=" " CommandName="Cancel" CausesValidation="false"
                        CssClass="CmsButLeft dark"><strong class="CmsButRight dark">Cancel</strong></asp:LinkButton>
                </p>
            </fieldset>
        </InsertItemTemplate>
    </telerik:RadListView>

    in this control if I add or edit a banner more than once i get the following error

    Error: window is null
    Source File: http://localhost/3dayblinds/sitefinity/admin/Modules.aspx?module=Products&route=ProductsControlPanel.ProductsView.ProductsEditView&Param=1f2fa64a-1cb3-4f08-84a7-2bf1fc914462
    Line: 765

    so i can't select an image.

    Kindly help me here,

    Nauman
Register for webinar
14 posts, 0 answered