Document selector with button
I'd like to know how I can add a sf-document-selector to a widget designer like e.g. the sf-page-selector.
The sf-page-selector is showing a button (select) which opens a window to select a page. The sf-document-selector is just showing the selector at once, and conflicts with other properties on my widget designer.
Can't I do something like:
<
sf-list-selector
sf-document-selector />
Best,
Daniel
Hi Mariush,
Thanks, this gives me the desired functionality.
When I place multiple MediaField components on my widget designer, it is only updating the first one.
What should be done to make this work?
<
tab
heading
=
"Downloads"
>
<
div
class
=
"form-group"
>
<
label
>Voorwaarden</
label
>
<
sf-media-field
sf-media-type
=
"documents"
id
=
"voorwaarden"
sf-model
=
"properties.DownloadVoorwaardenId.PropertyValue"
/>
</
div
>
<
div
class
=
"form-group"
>
<
label
>Bijlagenboekje</
label
>
<
sf-media-field
sf-media-type
=
"documents"
id
=
"bijlagenboekje"
sf-model
=
"properties.DownloadBijlagenBoekjeId.PropertyValue"
/>
</
div
>
<
div
class
=
"form-group"
>
<
label
>Handleiding</
label
>
<
sf-media-field
sf-media-type
=
"documents"
id
=
"handleiding"
sf-model
=
"properties.DownloadHandleidingId.PropertyValue"
/>
</
div
>
</
tab
>
So, if I choose a file from the second or third selector, it will update the first one.
Best,
Daniel
Any ideas on how to use multiple MediaFields inside a widget designer? It seems not to work when trying to persist values to the database. If I have 3 MediaFields that are bind to 3 different properties, the first one is the one that is updated 3 times, so always gets the value of the Document that is chosen from the DocumentSelector.
Best,
Daniel
Hi Daniel,
Could you please verify you are using different ids and scope properties for each media field?
Please, check also the binding in the designer javascript file, where the database values are updated.
Regards,
Nikola Zagorchev
Telerik
Has anyone had success in implementing this? I have found there are also problems if you are trying to use the kendo control and the sf-media-field in the same widget.
Thanks,
Randy
Hi Randy,
What kendo control you are trying to use? What errors do you receive?
You can check this widget with multiple selectors:
https://github.com/Sitefinity/feather-samples/tree/master/AuthorWidget
Regards,
Nikola Zagorchev
Telerik
I looked at the author widget and tried to add these two elements. The media field alone works perfectly. And the html field alone works perfectly. If you put these on the same page and try to add a document via the media field and then try to add a document through the open document selector through the kendo UI then it breaks.
IE I have a page with these two fields and can't add documents through the kendo-content-block.
<sf-media-field sf-media-type="documents" sf-model="selectedItems" />
<sf-html-field class="kendo-content-block" sf-model="properties.Text.PropertyValue"></sf-html-field>
When you try using kendo the document selector opens and you can select a document you just can't save it. The button to save is inactive because there is no selected document.
(I am new to customizing the widgets, but it certainly seems like there is a problem with the sf-media-field and trying to bind to it multiple times on the page, similar to the post that Daniel made)
Thanks,
Randy