Problem with initializing dojo widget from value stored in database



Where in the life cycle is it best to initialize a dojo property widget from the value that's stored in the database for that property?


I have a property of type IEnumerable and a backing type that serializes the collection, stores it in database and deserializes it back to a collection when the value is collected. As of now I'm checking in the _setValueAttr method of my dojo widget if the value is not empty and my javascript array is empty and then I setup the UI based on that.

The problem

My approach works fine if I go to "All properties" view and edit my property. The value that comes from the database is correct. However, when I click the property on page and the popup editor dialog (uiType floating) is displayed it looks like the value that comes into the _setValueAttr method is of type object and only contains the first item in the collection. What am I missing here?

The code

You can look at the code for my widget in this Gist.

Jul 02, 2015 15:35

Solved. Had to add "multiple" property with true value to widget. Very odd and confusing behavior to take the first occurance in an array and mix it in if the multiple property is not defined and set to true.

Edited, Jul 03, 2015 11:24
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.