More in this section

RadEditor

8 posts, 0 answered
  1. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    16 Jul 2010
    Link to this post
    Hi,

    I have a custom Images And Documents Module where a user can tag a document by selected hierarchical categories called research areas. I also have a custom Generic_Module that allows the user to create links to these documents by using the RadEditor option of inserting a document link into the content. I need to guarantee that each document that is linked is tagged with my custom hierarchical categories when the RadEditor insert document functionality is used to link in documents. Can  you tell me the best way to accomplish this goal? Thank you for you help in advance and I look forward to hearing from you.


    Thanks,
    Bobby
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Jul 2010
    Link to this post
    Hello Bobby,

    You need to create a custom selector that will pick up items from your library. After an item has been selected you have to get its ID and check whether it has been tagged.
    You could create a custom selector that inherits from Telerik.Libraries.WebControls.Dialogs.ItemSelector.cs. There you need to override CreateChildControls() and implement a custom view that will be loaded when you are in DisplayMode.ItemsView. In this custom view you need to bind a repeater to a library item. Inside ItemDataBound event of the repeater you could check whether the item has been tagged or not. If the item is not tagged you can just hide it and it will not appear. Another option is to create an argument for the ID and resolve it later - if the item is not tagged, show an alert.


    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
  3. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    16 Jul 2010
    Link to this post
    Thanks for you response Ivan,


    I do not want to disallow the user from selecting an item that is not tagged, ie. files uploaded from the disk. I want them to be able to tag the item with my custom hierarchical categories. So, I wanted to display my custom control that displays my categories and when the user tries to upload the item, I'd like to tie into the event that is fired after the upload is completed, get the content.ID and find the custom categories selected by the user and tag the content that was just saved.  Is this possible or am I explaining my problem correctly?

    Thanks again,
    Bobby
  4. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    16 Jul 2010
    Link to this post
    Ivan,

    I think I may have misunderstood your response. I want to be able to resuse the functionality already provided by the Item Selector but just add my custom control that displays my categories. When the user finishes selecting the item, I want to get the selected categories and tag the uploaded content with those selected categories. Is there an easy way of doing this without re-implementing the functionality already provided by the ItemSelector?


    Thanks,
    Bobby
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Jul 2010
    Link to this post
    Hi Bobby,

    The ItemSelector returns only Width, Height, AlternateText, Name as arguments to the RadWidnow that is used when you select an item. The only way that I can see is a new dialog or reuse some parts of the current one as described.  Basically you need the content item ID which is not passed by ItemSelector the the RadWindow. You can get the item ID only from the server side code of ItemSelector ( or another completely custom selector )

    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
  6. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    16 Jul 2010
    Link to this post
    If I created a custom control that inherited from an ItemSelector, how can I access to the uploaded content id? I thought I could register form the I'm Done button's event, but I am not sure how to get the content id.
  7. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    16 Jul 2010
    Link to this post
    If I created a custom control that inherited from an ItemSelector, how can I access to the uploaded content id? I thought I could register form the I'm Done button's event, but I am not sure how to get the content id. In addition, I my event handler for the I'm done button is not being called. I just put a simple redirect in the event handler to make sure it's was working. Any help would be greatly appreciated.

    public class ResearchAreaItemSelector : ItemSelector
        {
            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                LinkButton doneBtn = this.container.GetControl<LinkButton>("imDoneBtn", true, Telerik.Framework.Web.TraverseMethod.BreadthFirst);
                doneBtn.Click += new EventHandler(doneBtn_Click);
            }

            void doneBtn_Click(object sender, EventArgs e)
            {
                HttpContext.Current.Response.Redirect("http://www.google.com");
            }
        }



    Thanks,
    Bobby
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Jul 2010
    Link to this post
    Hello Bobby,

    In this custom view you need to bind a repeater to a library item. Inside ItemDataBound event of the repeater you should create an argument for the ID of the item. when you click "I'm Done" the ID of the Item should be returned as argument of the RadWindow and you should check its categories/tags. In your custom class you have to override CreateChildControls() and there implement a method that will bind a repeater to the items from your library.
    Sample code that shows how to create a custom selector has been provided in this post.


    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
Register for webinar
8 posts, 0 answered