Multiple Choice Dual List (With Sort)

by Trevor Fayas (Avastone Technologies LLC)
Multiple Choice Dual List (With Sort) preview

Price

$0

Details

Licence:
Free
Works with:
8.0, 8.1, 8.2, 9.0, 10.0
Version:

Web site

http://www.kentico.com/Partners/Avastone-Technologies-LLC

Summary

Multiple Select Form Control with dual lists and buttons to move items from one to the other, with optional ordering of the selected items.

Description

Cleaner UI for the standard Kentico Multiple Choice form control. This features a Dual List box, left containing remaining available items, and the right the selected items. Optional Ordering available (saves in Database as the order you place, ex: 1|3|2|5|4).

Note that if you wish to do a WHERE IN in a repeater to select these options, this alone will not display the options in order. You will need to do something similar to this in the Order By:
CHARINDEX(','+CONVERT(varchar, ItemID)+',', ',1,3,2,5,4,')

Comments


Trevor Fayas commented on

Andy, could be due to the version, it's working well on the multiple sites i have it but none are on that low of a version/hotfix.

Kevin Kim-Murphy commented on

Solution for the conflict between this control and the category selector was to simply reorder the fields so that the Category selector is above this control in the form.

The reason for this is that the Category selector refreshes the page - and this wipes out the data selected in this control - but not saved.

Kevin Kim-Murphy commented on

Wondering if you have experienced any conflicts between this control and the standard category selection control in Kentico? It seems that if I select categories AFTER I have used this control in the form tab - the act of selecting categories wipes out any selections I have made using the Multiple Choice Dual List
(Note: We are not using this control for selecting Categories - we are using this control to associate the page being edited or create to another page or pages)

Kevin Kim-Murphy commented on

Daniela Kubikova, that worked great, thank you! Most excellent.

Daniela Kubikova (Marketplace Administrator) commented on

Hi Kevin Kim-Murphy,

I will try to answer your questions.

a) I just tested the form control in 8.2 version and it seems to work well. I will add the 8.2 version into "Works with" field. The problem with missing files is very frequent. It's because it is necessary to tick the "Import files (recommended)" and "Import code files" check boxes in the Step 2 of the import process when importing some web parts or form controls from Marketplace.

b) I think that you will really have to write your own SQL query. Just select "SQL query" as a Data source of the form control and insert query like "SELECT ClassID, ClassDisplayName FROM CMS_Class WHERE ClassIsDocumentType = 1"

Kevin Kim-Murphy commented on

Hi. This seems like the perfect control for the scenario that I have - just a couple questions:

a) Does it work in version 8.2? I downloaded it from the Marketplace and imported the .zip package using Sites > Import site or Objects - the installation process seemed to work fine (i.e. no errors) and sure enough when I went to the field in Page Type > Fields I was able to select "Multiple choice Dual List With Order" as an option for my Form Control. But then when I went to the actual page Form tab - I get the following error:

[Error loading the FormControl 'MultipleChoiceControl_WithOrder']
The file '/CMSFormControls/Custom/MultipleChoiceControl_WithOrder.ascx' does not exist.

Looking in that directory I see that that is correct - there is no /Custom/MultipleChoiceControl_WithOrder.ascx file under /CMSFormControls

Please advise.

b) Once I get this working - I am hoping that there is an option to configure this to display a list of page_types in the left column for selection. Or do I need to write a SQL query to pull the necessary data? Please advise.

Thank you!

Trevor Fayas commented on

I've submitted and update to this module, including Andy Boot's fix, and a fix to the Javascript code that will detect if $cmsj is defined, if it is it will use that, otherwise it will use jQuery, that should ensure it works in both 8 and 8.1

Trevor Fayas commented on

Great post Andy!

I noticed another issue with 8.1, this module uses jQuery in it's javascript, however if running in 8.1 you need to adjust the /CMSFormControls/Custom/MultipleChoiceControl_WithOrder.aspx and replace all "jQuery" with "$cmsj".

Andy Boot commented on

Don't know if this is because I'm running 8.0.14, but I've experienced an issue with this form control upon postback after submission of my form. This would cause the listboxes to revert back to their original state prior to my changes.
I found this to be caused by the hidden Previous Values textbox not be updated after submission (postback).
I fixed this very easily, though took a while to figure out.
Within public override object Value{ }, replace the set{} with:
selectedValues = ValidationHelper.GetString(value, String.Empty).Split('|');
previousItems.Text = ValidationHelper.GetString(value, String.Empty);
LoadAndSelectList();

Simples!