Creating a custom visitor group criteria with dynamic dropdown

Vote:
 

Hi!

I'm trying to create a custom visitor group criteria with a dropdown. The only examples I've seen are with enumerators and predefined values in dropdowns. The thing I would like to do is to populate the dropdown with dynamic values from a database. Is this doable at all? Preferably without using ajax but if that's the only way I'm up for it. ;)

regards
Christina 

#52098
Jul 06, 2011 8:46
Vote:
 

Hi!

What you would need to do is to implement an ISelectionFactory. The interface only has one method, GetSelectListItems, that should return the options that should appear in the drop down list.

Then you can decorate a property on your model class with the DojoWidget attribute, do indicatate that it should use that factory. It would look something like this:

[DojoWidget(SelectionFactoryType = typeof(MyCustomSelectionFactory))]
public string MyValue { get; set; }

Regards

Per Gunsarfs
EPiServer Development Team

#52099
Edited, Jul 06, 2011 10:34
Vote:
 

Thank you so much for your help! I'll try that! :)

#52101
Jul 06, 2011 12:53
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.