Hi,
I'm trying to implement a ProductFieldTypeProvider with a UserGroupParameterEditor. But cannot find any documentation about how to do it.
I have a class that inherits from ProductFIeldTypeProvider but when i add that in the "Field types" I get the following error:
"UserSelectorSettings is not defined"
Are there any examples on how to implement a ProductFieldType with a UserGroupParameterEditor?
My class so far:
namespace Softgear.Industrilas.Data.Provider
{
[AddInName("Mindflower.UserGroupSelectProvider")]
[AddInLabel("User Group Selector")]
[AddInActive(true)]
[Serializable]
public class UserGroupSelectProvider : ProductFieldTypeProvider, IDropDownOptions
{
private Lazy<Dictionary<string, string>> _options;
public UserGroupSelectProvider()
{
_options = new Lazy<Dictionary<string, string>>();
}
public override object GetValue(object value, string languageId, Dictionary<string, string> settings)
{
return "Testing usergroups";
}
public override string GetAppenderInfo(string languageId, string settings)
{
return GetAppenderInfo(languageId, GetParameterValues(settings));
}
public override object GetProductValue(Product product, object fieldValue, string languageId, Dictionary<string, string> settings)
{
return "Getting product value";
}
public override string GetAppenderInfo(string languageId, Dictionary<string, string> settings)
{
return "In GetAppenderInfo";
}
protected override void Render(TextWriter writer, string id, bool enabled, string value, bool hasError, string text, string title)
{
// What should I put here
}
[AddInParameter("Usergroups")]
[AddInParameterEditor(typeof(UserGroupParameterEditor), "multiple=false;")]
[AddInParameterGroup("Locations")]
public string[] Usergroups { get; set; }
public Hashtable GetOptions(string dropdownName)
{
// Get Hashtable
Hashtable options = new Hashtable();
foreach (var key in _options.Value.Keys)
{
options.Add(key, _options.Value[key]);
}
// Return the hashtable
return options;
}
}
}