unable to store multi selection listbox values from Custom Widget designer
Hi,
I have a multi selection list box in one of my custom widget designers. I would like the selected values form this list box to be saved as a list of guid to my controller's property. I cant seem to find any example for this. I have tried to get the selected values from the list box as a java script array and assign it to the Controller property but it doesn't work.
=====Custom Widget designer ascx file=======
<select size="4" multiple="multiple" id="NewsTypes" class="rss-listbox valid">
<option value="63ae86cc-3500-6b76-8c45-ff00006d12a1">Internal News</option>
<option value="96ae86cc-3500-6b76-8c45-ff00006d12a1">External News</option>
</select>
======= Custom Widget designer JS file======================
applyChanges: function ()
var controlData = this._propertyEditor.get_control();
var array = [];
jQuery('select.rss-listbox :selected').each(function (i, selected)
array[i] = jQuery(selected).val();
);
controlData.NewsTypes = array;
=====Custom widget Controller =============
[Category("Table Data")]
public List<Guid> NewsTypes get; set;
Hello Suneeth,
Can you provide more information about the issue? What part of the functionality does not work? You can try to create an MVC Widget with designer using Sitefinity Thunder and inspect its designer functionality.
In addition, are you able to get the selected value/s? Another option is to pass the selected values as string and split them in the controller. Also ensure that the selected values are guids but not string.
You can attache the widgets or an isolated sample in order to inspect it.
Regards,
Svetoslav Manchev
Telerik