FileField usage in widget designer

Posted by Community Admin on 04-Aug-2018 14:48

FileField usage in widget designer

All Replies

Posted by Community Admin on 06-Dec-2011 00:00

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.

Posted by Community Admin on 09-Dec-2011 00:00

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

Posted by Community Admin on 12-Dec-2011 00:00

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.

Posted by Community Admin on 14-Dec-2011 00:00

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

Posted by Community Admin on 11-Mar-2013 00:00

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?

Posted by Community Admin on 14-Mar-2013 00:00

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

This thread is closed