More in this section

Forums / Developing with Sitefinity / ButtonSelector control that works with Document Libraries too?

ButtonSelector control that works with Document Libraries too?

5 posts, 0 answered
  1. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    18 Dec 2008
    Link to this post
    Hi there,

    I'm working on a custom module that allows me to add products to my custom data table. Things were going along smoothly until I attempted to add two ButtonSelectors to add links to images from my Image Libraries and then add another ButtonSelector to add a link to a doc which is stored in Document Library.

    1. It looks like the ButtonSelector control is for Image Libraries only, is this correct? Is there an easy way to allow it to display document libraries too?

    2. In order to get the multiple ButtonSelectors to work on the same page I added the changes recommened in this post. http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bgmhag.aspx Unfortunately this now breaks the RadEditors ability to insert existing images/documents. Is there a better fix for this than the above post that won't break the RadEditor's LibraryImageManager and LibraryDocumentManager?

    3. Since the ButtonSelector seems to be Image Libraries only and the majority of the work is done in compiled code, is there any way you'd share the code just for this control so that I could acelerate the process of creating a selector that allows for selecting Images and/or Documents?

    4. If this solution exists already, please someone point me in the right direction :D Thanks!!

    Many thanks in advance for any help on this!
    Cheers,
    Phill

  2. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    18 Dec 2008
    Link to this post
    So with further digging I answered part 1. to the question above. Adding the following attribute to the ButtonSelector allowed me to browse Document Libraries (but not both which is what I'd prefer). 

    <sfLib:ButtonSelector ID="ButtonSelector3"  WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ItemDialog.aspx" .....

    Is there a way to get it to display both? Also, the multiple selectors breaking the ImageManager in Rad Editor still exists. To clarify it happens when clicking on the "Select from already uploaded images" link, and it's a JS error "Line 4149, Sys.ArgumentUndefinedException: Value cannot be undefined..." The issue is that the fix to have multiple requires a clientID and associatedControls array, but the client ID is null.

    Hope that helps someone and hope it helps someone else help me :)

    Thanks again!
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Dec 2008
    Link to this post
    Hi Phill Hodgkinson,

    Thank you for using our services.

    Please take a look at the following KB article How to associate content items with files. This will allow you to select images and documents from your library( Image and Documents Libraries). There is a problem with multiple selector instances on the same page. We are working on this issue.

    I hope this helps.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Jean
    Jean avatar
    90 posts
    Registered:
    06 Nov 2008
    18 May 2009
    Link to this post
    Hi There,

    Any news on when this bug will be resolved?

    Regards,
    Jean Erasmus
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    19 May 2009
    Link to this post
    Hi Jean,

    We changed the control designers and we use ButtonSelector instead of LinkButton with CommandArgument set to the web editor.
    However we found another problem related to the value of the texbox control. The id of the additional textboxes cannot be found. There is a solution that require using beforeInsertLink function.

    Sample code:

    <script type="text/javascript">  
        function beforeInsertLink(src, altText, title, width, height) {  
            var textBox = document.getElementById('<%= TEST.ClientID %>');  
            textBox.value = src;  
              
        }  
    </script>  

    The problem persists in the last  official release and it has been logged for fixing.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
5 posts, 0 answered