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

Forums / Developing with Sitefinity / FileField usage in widget designer

FileField usage in widget designer

6 posts, 0 answered
  1. Goulutor
    Goulutor avatar
    5 posts
    Registered:
    08 Sep 2011
    06 Dec 2011
    Link to this post
    Hi, 
    I'm looking for code samples showing the usage of a FileField in a widget designer. At the moment, I have successfully created a FileField which shows up in my widget designer, but I doesn't work as expected. I can select a file, but the file cannot be saved.

    And how can I display the library of documents of my Sitefinity website ?

    Here is the code I'm using:
    <div>
        <sf:SitefinityLabel ID="SitefinityLabel3" runat="server" WrapperTagName="h2" HideIfNoText="false"
            Text="File:" />
        <sitefinity:FileField ID="FileSelector" runat="server" DisplayMode="Write" DataFieldName="File" />
    </div>
    protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
    {
        // set the image selector type to use string (src)            
        FileSelector.MaxFileCount = 1;
        FileSelector.ItemName = "File";
        FileSelector.ItemNamePlural = "File";
        FileSelector.IsMultiselect = false;
        FileSelector.LibraryContentType = typeof(Telerik.Sitefinity.Libraries.Model.Document);
        FileSelector.DisplayMode = FieldDisplayMode.Write;             
    }

    /// <summary>
    /// Gets the file selector.
    /// </summary>
    protected FileField FileSelector
    {
    get { return Container.GetControl<FileField>("FileSelector", true); }
    }

    Am I missing something ?

    Thanks

    Julien T.

  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    09 Dec 2011
    Link to this post
    Hello Julien,

    Please check the following blog post:

    http://www.sitefinity.com/blogs/joshmorales/posts/11-10-05/selecting_sitefinity_4_content_inside_widget_designers.aspx

    I think you would find useful information there.

    All the best,
    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Goulutor
    Goulutor avatar
    5 posts
    Registered:
    08 Sep 2011
    12 Dec 2011
    Link to this post
    Hi,
    Thanks for the blog post, but I already read that article and it doesn't explain the usage of FileField, but only ImageField which is quite different since it is fully integrated in the widget designer. The FileField seems to redirect to a new page allowing file management.
    I searched a lot of articles but didn't found any explanation about the FileField !

    Thanks

    Julien T.
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    14 Dec 2011
    Link to this post
    Hello Goulutor,

    There aren't currently any documentation about the FileField. I have started a series of blog posts that will try to explain in details how to use the different selectors and fields in Sitefinity. Here is the first article in the series:

    http://www.sitefinity.com/blogs/lubomirvelkov/posts/11-11-30/using_sitefinity_s_selectors_in_custom_field_controls_-_part_1_-_page_selector_field.aspx 

    I will try to publish a second article by the end of the year about ImageSelector and FileField selector.

    Greetings,
    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Martin Chamorro
    Martin Chamorro avatar
    5 posts
    Registered:
    03 Feb 2010
    11 Mar 2013 in reply to Lubomir Velkov
    Link to this post

    It's been over a year since these posts. Was there ever a blog post or documentation on how to use the FileField in a widget designer? I looked at your blog but I didn't see you ever make a post giving instructions on this. The help documents I have found only show us how to use the ImageField and Page Selectors but not the FileField. Can you please explain how to use the FileField selector in the widget designer?

  6. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    14 Mar 2013
    Link to this post
    Hello,

    Would it be possible to describe the scenario you are trying to achieve? Are you trying to upload files or select files that are already uploaded? 

    Greetings,
    Atanas Valchev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered