Try our conversational search powered by Generative AI!

Custom property with typed value


Lets say I want to build a custom property that returns an IEnumerable. Like the PropertyStringList in Alloy MVC template project but IEnumerable instead of string[]. I have laborated a bit but I have problems. The Value property returns null or an object of type string[] and the PropertyValueType returns typeof(IEnumerable).

First, I try this without a custom dojo-editor, I use the dojo-editor for PropertyLongString. I declare an EditorDescriptor for that. If I dont register an EnumerableStringJsonConverter I get an error on autosave saying something like "Could not convert from IEnumerable to string". If I declare an EnumerableStringJsonConverter the autosave works but after that I can not enter the forms-mode (clicking All Properties). When clicking "All Properties" it starts roling, I never enter the forms-mode, it hangs. There are no errors in the log4net logs and no info helping even when I enable info and debug. I get no errors in the Chrome console.

  • Is it possible having an abstract type returned by PropertyValueType, like IEnumerable? Or does it have to be a concrete type, like string[].
  • Do I need a custom dojo-editor? The PropertyStringList works but not mine, is that because I use the PropertyLongString-editor? Searching the Alloy MVC template code for a JsonConverter finds no one.

It is hard to find the problem when there are no exception logged at all.

I hope someone can help!

Regards Hans

Nov 14, 2014 13:41
* 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.