Index: Dev/branches/rest-dojo-ui/client/rft/css/surveyEditor.css
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/css/surveyEditor.css	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/css/surveyEditor.css	(revision 402)
@@ -3,5 +3,5 @@
 	display: block;
 	color: #ffffff;
-	padding: 0 8px;
+	/*padding: 0 8px;*/
 }
 
@@ -54,4 +54,8 @@
 
 /* Drag and drop anchor highlighting */
+.claro .dojoDndItemAnchor, .claro .dojoDndItemOver {
+    background-color: inherit;
+}
+/*
 .claro div.blue.dojoDndItemAnchor .topBorder,
 .claro .blue .dojoDndItemAnchor .topBorder {
@@ -74,2 +78,3 @@
 	background-color: #993dec;
 }
+*/
Index: Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 402)
@@ -99,5 +99,5 @@
             },
             _onShowPreview: function() {
-                content.goTo('previewSurvey', {uid: store.getIdentity(this.survey)});
+                content.goTo('viewSurvey', {uid: store.getIdentity(this.survey)});
             }
         });
Index: Dev/branches/rest-dojo-ui/client/rft/store.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 402)
@@ -1,4 +1,4 @@
-define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/array','dojo/_base/Deferred','dojo/_base/xhr','dojo/json','dojo/store/util/QueryResults'],
-    function(declare,lang,array,Deferred,xhr,JSON,QueryResults){
+define(['dojo/_base/declare','dojo/_base/json','dojo/_base/lang','dojo/_base/array','dojo/_base/Deferred','dojo/_base/xhr','dojo/store/util/QueryResults'],
+    function(declare,json,lang,array,Deferred,xhr,QueryResults){
     
         var CouchStore = declare(null, {
@@ -58,5 +58,5 @@
 		        xhr(hasId ? "PUT" : "POST", {
 				    url: hasId ? this.target + id : this.target,
-				    postData: JSON.stringify(object),
+				    postData: json.toJson(object),
 				    handleAs: "json",
 				    headers:{
@@ -193,5 +193,5 @@
 
                 for (var qp in queryOpts) {
-                    queryOpts[qp] = JSON.stringify(queryOpts[qp]);
+                    queryOpts[qp] = json.toJson(queryOpts[qp]);
                 }
 			    query += '?' + xhr.objectToQuery(queryOpts);
Index: Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 402)
@@ -19,5 +19,5 @@
 			userObject: null,
 
-			actions: {},
+			actions: null,
 			postCreate: function() {
 				dom.setSelectable(this.domNode, false); // Text selection, has nothing to do with object selection!
@@ -31,4 +31,7 @@
 			},
 			_setupActions: function() {
+                if ( this.actions === null ) {
+                    return;
+                }
 				for (var action in this.actions) {
 					var properties;
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 402)
@@ -25,69 +25,46 @@
             _categories : null,
 
-            _contentItems: [{
-                    label: "Header",
-                    content: {
-                        type: "Header"
-                    },
-                    icon: "Header"
-                },{
-                    label: "Text",
-                    content: {
-                        type: "Text"
-                    },
-                    icon: "TextBox"
-                },{
-                    label: "Image",
-                    content: {
-                        type: "Image"
-                    },
-                    icon: "Image"
-                },{
-                    label: "External media",
-                    content: {
-                        type: "ExternalMedia"
-                    },
-                    icon: "External"
-                },{
-                    label: "Divider",
-                    content: {
-                        type: "Divider"
-                    },
-                    icon: "Divider"
-                }],
-            _inputsItems: [{
-                    label: "Free text",
-                    content: {
-                        type: "FreeTextInput"
-                    },
-                    icon: "Text"
-                },{
-                    label: "Integer",
-                    content: {
-                        type: "IntegerInput"
-                    },
-                    icon: "Integer"
-                },{
-                    label: "Scale",
-                    content: {
-                        type: "ScaleInput"
-                    },
-                    icon: "Scale"
-                },{
-                    label: "Cards",
-                    content: {
-                        type: "CardsInput"
-                    },
-                    icon: "Cards"
-                },{
-                    label: "Multiple Choice",
-                    content: {
-                        type: "MultipleChoiceInput"
-                    },
-                    icon: "MultipleChoice"
-                }],
+            _contentItems: [
+                { type: "Header" },
+                { type: "Text" },
+                { type: "Image" },
+                { type: "ExternalMedia" },
+                { type: "Divider" }
+            ],
+            _inputsItems: [
+                { type: "StringInput" },
+                { type: "TextInput" },
+                { type: "IntegerInput" },
+                { type: "ScaleInput" },
+                { type: "MultipleChoiceInput" }
+            ],
+            _labelMap: {
+                "Header": "Header",
+                "Text": "Text",
+                "Image": "Image",
+                "ExternalMedia": "External media",
+                "Divider": "Divider",
+                "StringInput": "Text line",
+                "TextInput": "Free text",
+                "IntegerInput": "Integer number",
+                "ScaleInput": "Scale",
+                "MultipleChoiceInput": "Multiple choice"
+            },
+            _iconMap: {
+                "Header": "Header",
+                "Text": "TextBox",
+                "Image": "Image",
+                "ExternalMedia": "External",
+                "Divider": "Divider",
+                "StringInput": "Text",
+                "TextInput": "Text",
+                "IntegerInput": "Integer",
+                "ScaleInput": "Scale",
+                "MultipleChoiceInput": "MultipleChoice"
+            },
 
             postCreate: function(){
                 this.inherited(arguments);
+                var creator = lang.hitch(this,"_creator");
                 this.contentSource = new Source(this.ToolkitContentSourceNode, {
                     accept: [],
@@ -95,5 +72,5 @@
                     selfAccept: false,
                     singular: true,
-                    creator: this._creator
+                    creator: creator
                 });
                 this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
@@ -102,5 +79,5 @@
                     selfAccept: false,
                     singular: true,
-                    creator: this._creator
+                    creator: creator
                 });
                 this.contentSource.insertNodes(false, this._contentItems);
@@ -127,11 +104,11 @@
                 if (hint == "avatar") {
                     node = domConstruct.create('span',{
-                        innerHTML: item.label
+                        innerHTML: this._labelMap[item.type] || item.type
                     });
                 } else {
                     var w = new Button({
                         baseClass: "rftLargeButton",
-                        iconClass: "rftIcon rftIcon"+item.icon,
-                        label: item.label,
+                        iconClass: "rftIcon rftIcon"+(this._iconMap[item.type]||"Unknown"),
+                        label: this._labelMap[item.type] || item.type,
                         showLabel: true,
                         'class': "newline"
@@ -139,5 +116,5 @@
                     node = w.domNode;
                 }
-                return {node: node, data: item.content, type: ["questionContent"]};
+                return {node: node, data: item, type: ["questionContent"]};
             },
             _setupListView: function() {
Index: Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 402)
@@ -1,302 +1,459 @@
 define([
+    'dojo/_base/array',
     'dojo/_base/declare',
     'dojo/_base/lang', 
+    'dojo/dom-construct', 
     'dijit/_WidgetBase',
     'dijit/_Container',
+    'dijit/form/Button',
+    'dijit/form/CheckBox',
     'dijit/form/NumberSpinner',
+    'dijit/form/RadioButton',
     'dijit/form/Textarea',
     'dijit/form/TextBox',
-    'dijit/form/CheckBox',
-    'dijit/layout/StackContainer',
-    'dojox/form/CheckedMultiSelect',
-    'dojox/layout/TableContainer'
-    ],function(declare, lang, _WidgetBase, _Container, NumberSpinner, Textarea, TextBox, CheckBox, StackContainer, CheckedMultiSelect, TableContainer) {
-        var factory = declare('rft.ui.content.ContentWidgetFactory', [], {
-            /* No default type, all should be valid */
-            createViewWidget: function(/*Object*/options) {
-                // options: Object
-                //            type: "header", "text", textinput, etc.
-                //            other type specific fields
-                var fun = this['create'+options.type+'ViewWidget'];
-                var view = fun !== undefined ? fun(options) : null;
-                return view;
-            },
-            createEditWidget: function(/*Object*/options) {
-                var fun = this['create'+options.type+'EditWidget'];
-                var view = fun !== undefined ? fun() : null;
-                if(view)
-                    view.set('value', options);
-                return view;
-            },
-
-            createHeaderViewWidget: function(options) {
-                return new HeaderViewItem({
-                    options: options
+    'dojox/layout/TableContainer',
+    './../lists/OrderedList'
+],function(array, declare, lang, domConstruct, _WidgetBase, _Container, Button, CheckBox, NumberSpinner, RadioButton, Textarea, TextBox, TableContainer, OrderedList) {
+    var factory = declare('rft.ui.content.ContentWidgetFactory', [], {
+        /* No default type, all should be valid */
+        createViewWidget: function(/*Object*/options) {
+            // options: Object
+            //            type: "header", "text", textinput, etc.
+            //            other type specific fields
+            var fun = this['create'+options.type+'ViewWidget'];
+            var view = fun !== undefined ? fun(options) : null;
+            return view;
+        },
+        createEditWidget: function(/*Object*/options) {
+            var fun = this['create'+options.type+'EditWidget'];
+            var view = fun !== undefined ? fun() : null;
+            if(view)
+                view.set('value', options);
+            return view;
+        },
+
+        createHeaderViewWidget: function(options) {
+            return new HeaderView({
+                options: options
+            });
+        },
+        createHeaderEditWidget: function() {
+            return new HeaderEdit();
+        },
+
+        createTextViewWidget: function(options) {
+            return new TextView({
+                options: options
+            });
+        },
+        createTextEditWidget: function() {
+            return new TextEdit();
+        },
+
+        createDividerViewWidget: function(options) {
+            return new DividerView({
+                options: options
+            });
+        },
+
+        createStringInputViewWidget: function(options) {
+            return new StringInputView({
+                options: options
+            });
+        },
+        createStringInputEditWidget: function() {
+            return new StringInputEdit();
+        },
+
+        createTextInputViewWidget: function(options) {
+            return new TextInputView({
+                options: options
+            });
+        },
+        createTextInputEditWidget: function() {
+            return new TextInputEdit();
+        },
+
+        createIntegerInputViewWidget: function(options) {
+            return new IntegerInputView({
+                options: options
+            });
+        },
+        createIntegerInputEditWidget: function() {
+            return new IntegerInputEdit();
+        },
+
+        createMultipleChoiceInputViewWidget: function(options) {
+            return new MultipleChoiceInputView({
+                options: options
+            });
+        },
+        createMultipleChoiceInputEditWidget: function() {
+            return new MultipleChoiceInputEdit();
+        }
+    });
+
+    var HeaderView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<h2>"+this.options.content+"</h2>";
+        }
+    });
+
+    var HeaderEdit = declare([_WidgetBase, _Container], {
+        _textBox: null,
+        postCreate: function() {
+            this._textBox = new TextBox();
+            this.addChild(this._textBox);
+            this._textBox.startup();
+        },
+        _setValueAttr: function(value) {
+            this._textBox.set('value', value.content || "");
+        },
+        _getValueAttr: function() {
+            return { type: 'Header',
+                 content: this._textBox.get('displayedValue')
+            };
+        }
+    });
+
+    var TextView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<p>"+this.options.content+"</p>";
+        }
+    });
+
+    var TextEdit = declare([_WidgetBase, _Container], {
+        _textArea: null,
+        postCreate: function() {
+            this._textArea = new Textarea();
+            this.addChild(this._textArea);
+            this._textArea.startup();
+        },
+        _setValueAttr: function(value) {
+            this._textArea.set('value', value.content || "");
+        },
+        _getValueAttr: function() {
+            return { type: 'Text',
+                 content: this._textArea.get('displayedValue')
+            };
+        }
+    })
+
+    var DividerView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<hr>";
+        }
+    });
+
+    var StringInputView = declare([_WidgetBase, _Container],{
+        _textBox: null,
+        postCreate: function() {
+            this._textBox = new TextBox();
+            this.addChild(this._textBox);
+            this._textBox.startup();
+        },
+        _setReadOnlyAttr: function(value) {
+            this._textBox.set('readOnly', value);
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._textBox.get('value') || "";
+        },
+        _setValueAttr: function(value) {
+            this._textBox.set('value',value || "");
+        }
+    });
+
+    var StringInputEdit = declare([_WidgetBase, _Container],{
+        _codeInput: null,
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            this._codeInput = new TextBox({
+                title: "Code"
+            });
+            table.addChild(this._codeInput);
+            this._codeInput.startup();
+
+            this.addChild(table);
+            table.startup();
+        },
+        _getValueAttr: function() {
+            return {
+                type: "StringInput",
+                code: this._codeInput.get('value') || ""
+            };
+        },
+        _setValueAttr: function(value) {
+            this._codeInput.set('value', value.code || "");
+        }
+    });
+
+    var TextInputView = declare([_WidgetBase, _Container], {
+        _textArea: null,
+        postCreate: function() {
+            this._textArea = new Textarea();
+            this._textArea.set('maxLength', this.options.maxLength || 1000);
+            this._textArea.set('value', this.options.defaultValue || "");
+            this.addChild(this._textArea);
+            this._textArea.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._textArea.get('value');
+        },
+        _setReadOnlyAttr: function(value) {
+            this._textArea.set('readOnly', value);
+        }
+    });
+
+    var TextInputEdit = declare([_WidgetBase, _Container], {
+        _codeInput: null,
+        _maxLengthInput: null,
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            this._codeInput = new TextBox({
+                title: "Code"
+            });
+            table.addChild(this._codeInput);
+            this._codeInput.startup();
+
+            this._maxLengthInput = new NumberSpinner({
+                title: "Maximum length",
+                constraints: {
+                    min: 0
+                }
+            });
+            table.addChild(this._maxLengthInput);
+            this._maxLengthInput.startup();
+
+            this.addChild(table);
+            table.startup();
+        },
+
+        _setValueAttr: function(value) {
+            this._codeInput.set('value', value.code || "");
+            this._maxLengthInput.set('value', value.maxLength);
+        },
+        _getValueAttr: function() {
+            return {
+                type: "TextInput", 
+                code: this._codeInput.get('value') || "",
+                maxLength: this._maxLengthInput.get('value')
+            };
+        }
+    });
+
+    var IntegerInputView = declare([_WidgetBase, _Container], {
+        _numberInput: null,
+        postCreate: function() {
+            this._numberInput = new NumberSpinner({
+                constraints: {
+                    min: this.options.min,
+                    max: this.options.max,
+                    smallDelta: this.options.step
+                }
+            });
+            this.addChild(this._numberInput);
+            this._numberInput.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._numberInput.get('value');
+        },
+        _setReadOnlyAttr: function(value) {
+            this._numberInput.set('readOnly', value);
+        }
+    });
+
+    var IntegerInputEdit = declare([_WidgetBase, _Container], {
+        _codeInput: null,
+        _minInput: null,
+        _maxInput: null,
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            this._codeInput = new TextBox({
+                title: "Code"
+            });
+            table.addChild(this._codeInput);
+            this._codeInput.startup();
+
+            this._minInput = new NumberSpinner({
+                title: "Minimum"
+            });
+            table.addChild(this._minInput);
+            this._minInput.startup();
+
+            this._maxInput = new NumberSpinner({
+                title: "Maximum"
+            });
+            table.addChild(this._maxInput);
+            this._maxInput.startup();
+
+            this._stepInput = new NumberSpinner({
+                title: "Step"
+            });
+            table.addChild(this._stepInput);
+            this._stepInput.startup();
+
+            this.addChild(table);
+            table.startup();
+        },
+
+        _setValueAttr: function(value) {
+            this._codeInput.set('value', value.code || "");
+            this._minInput.set('value', value.min);
+            this._maxInput.set('value', value.max);
+            this._stepInput.set('value', value.step);
+        },
+        _getValueAttr: function() {
+            return {
+                type: "IntegerInput",
+                code: this._codeInput.get('value') || "",
+                min: this._minInput.get('value'),
+                max: this._maxInput.get('value'),
+                step: this._stepInput.get('value')
+            };
+        }
+    });
+
+    var MultipleChoiceInputView = declare([_WidgetBase, _Container], {
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            var ctor = this.options.multiple === true ? CheckBox : RadioButton;
+            array.forEach(this.options.items || ["Aap", "Noot"],function(item){
+                table.addChild(new ctor({
+                    title: item
+                }));
+            },this);
+
+            this.addChild(table);
+            table.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            var checked = array.filter(this.getChildren(),function(child){
+                return child.get('checked');
+            });
+            if ( this.options.multiple ) {
+                return array.map(checked,function(child){
+                    return child.get('value');
                 });
-            },
-            createHeaderEditWidget: function() {
-                return new HeaderEditItem();
-            },
-
-            createTextViewWidget: function(options) {
-                return new TextViewItem({
-                    options: options
-                });
-            },
-            createTextEditWidget: function() {
-                return new TextEditItem();
-            },
-
-            createFreeTextInputViewWidget: function(options) {
-                return new FreeTextViewItem({
-                    options: options
-                });
-            },
-            createFreeTextInputEditWidget: function() {
-                return new FreeTextEditItem();
-            }/*,
-
-            createIntegerViewWidget: function(options) {
-                return new IntegerViewItem({
-                    options: options
-                });
-            },
-            createIntegerEditWidget: function(options) {
-                return new IntegerEditItem({
-                    options: options
-                });
-            },
-
-            createMultipleChoiceViewWidget: function(options) {
-                return new MultipleChoiceViewItem({
-                    options: options
-                });
-            },
-            createMultipleChoiceEditWidget: function(options) {
-                return new MultipleChoiceEditItem({
-                    options: options
-                });
-            }*/
-        });
-
-        /* Contents */
-        var HeaderViewItem = declare([_WidgetBase, _Container], {
-            _textBox: null,
-            postCreate: function() {
-                this._textBox = new TextBox();
-                this._textBox.set('value', this.options.contents);
-                this.addChild(this._textBox);
-            },
-            _getValueAttr: function() {
-                return {    type: 'Header',
-                            contents: this._textBox.get('displayedValue')
-                };
-            },
-            _setReadOnlyAttr: function(value) {
-                this._textBox.set('readOnly', value);
+            } else {
+                return checked.length > 0 ? checked[0].get('value') : null;
             }
-        });
-
-        var HeaderEditItem = declare([_WidgetBase, _Container], {
-            _textBox: null,
-            postCreate: function() {
-                this._textBox = new TextBox();
-                this.addChild(this._textBox);
-            },
-            _setValueAttr: function(value) {
-                this._textBox.set('value', value.contents || "");
-            },
-            _getValueAttr: function() {
-                return { type: 'Header',
-                         contents: this._textBox.get('displayedValue')
-                };
-            }
-        });
-
-        var TextViewItem = declare([_WidgetBase, _Container], {
-            _textArea: null,
-            postCreate: function() {
-                this._textArea = new Textarea();
-                this._textArea.set('value', this.options.contents);
-                this.addChild(this._textArea);
-            },
-            _getValueAttr: function() {
-                return { type: 'Text',
-                         contents: this._textArea.get('displayedValue')
-                };
-            },
-            _setReadOnlyAttr: function(value) {
-                this._textArea.set('readOnly', value);
-            }
-        });
-
-        var TextEditItem = declare([_WidgetBase, _Container], {
-            _textArea: null,
-            postCreate: function() {
-                this._textArea = new Textarea();
-                this.addChild(this._textArea);
-            },
-            _setValueAttr: function(value) {
-                this._textArea.set('value', value.contents || "");
-            },
-            _getValueAttr: function() {
-                return { type: 'Text',
-                         contents: this._textArea.get('displayedValue')
-                };
-            }
-        })
-
-        /* Inputs */
-        var FreeTextViewItem = declare([_WidgetBase, _Container], {
-            _textArea: null,
-            postCreate: function() {
-                this._textArea = new Textarea();
-                this._textArea.set('maxLength', this.options.maxLength || 1000);
-                this._textArea.set('value', this.options.defaultValue || "");
-                this.addChild(this._textArea);
-            },
-            _getValueAttr: function() {
-                return { type: "FreeTextInput",
-                         defaultValue: this.options.defaultValue,
-                         maxLength: this.options.maxLength
-                };
-            },
-            _setReadOnlyAttr: function(value) {
-                this._textArea.set('readOnly', value);
-            }
-        });
-
-        var FreeTextEditItem = declare(StackContainer, {
-            _propertiesTable: null,
-            _maxLength: null, _readOnly: null, _defaultValue: null,
-
-
-            postCreate: function() {
-                this._textArea = new Textarea();
-                this._propertiesTable = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
-                this._maxLength = new NumberSpinner( { title: "Maximum length", constraints: {min:0}} );
-                this._readOnly = new CheckBox( { title: "Read only" } );
-                this._defaultValue = new Textarea( { title: "Default value" });
-                this._propertiesTable.addChild(this._maxLength);
-                this._propertiesTable.addChild(this._readOnly);
-                this._propertiesTable.addChild(this._defaultValue);
-                this.addChild(this._propertiesTable);
-            },
-
-            _setValueAttr: function(value) {
-                this._maxLength.set('value', value.maxLength);
-                this._readOnly.set('value', value.readOnly);
-                this._defaultValue.set('value', value.defaultValue);
-            },
-            _getValueAttr: function() {
-                return { type: "FreeTextInput", 
-                         defaultValue: this._defaultValue.get('value'),
-                         readOnly: this._readOnly.get('value'),
-                         maxLength: this._maxLength.get('value')
-                };
-            }
-
-
-        })
-
-        //Use CheckedMultiSelect
-        var MultipleChoiceInput = declare(StackContainer, {
-            _multiSelect: null,
-            startup: function() {
-                this.inherited(arguments);
-                this._multiSelect = new CheckedMultiSelect();
-                this._multiSelect.addOption({ label: "Hurr durr", value: 1 });
-                this._multiSelect.addOption({ label: "This is a choice", value: 1 });
-                this._multiSelect.addOption({ label: "This too", value: 1 });
-                this._multiSelect.addOption({ label: "So because there are more", value: 1 });
-                this._multiSelect.addOption({ label: "This must be multiple choice.", value: 1 });
-                this.addChild(this._multiSelect);
-            },
-
-            setObject: function() {
-                return;
-            },
-
-            edit: function() {
-                return;
-            }
-
-        });
-
-        var IntegerInput = declare(StackContainer, {
-            _numberSpinner:  null,
-            _simpleTable: null,
-            _editWidgets: null,
-            _editTable: null,
-            startup: function() {
-                this.inherited(arguments);
-                this._numberSpinner = new NumberSpinner( { title: "Answer", value: 0, constraints: { min: -100, max: 100 } });    
-                this._simpleTable = new TableContainer({ cols: 1, customClass: "labelsAndValues", labelWidth : 150} );
-                this._simpleTable.addChild(this._numberSpinner);
-                this._editTable = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
-                this._simpleTable.startup();
-                this.addChild(this._simpleTable);
-            },
-            edit: function() {
-                this.removeChild(this._simpleTable);
-                this.addChild(this._editTable);
-            },
-            save: function () {
-                for (var widget in this._editWidgets) {
-                    var w = this._editWidgets[widget];
-                    if (w.value) {
-                        if (w.constraint)
-                            this._numberSpinner.constraints[w.field] = w.value;
-                        else 
-                            this._numberSpinner.set(w.field, w.value);
-                    }
+        },
+        _setReadOnlyAttr: function(value) {
+            array.forEach(this.getChildren(),function(child){
+                child.set('readOnly', value);
+            },this);
+        }
+    });
+
+    var MCOptionItem = declare([_WidgetBase,_Container],{
+        _textBox: null,
+        postCreate: function() {
+            this.innerHTML = '<span class="dojoDndHandle">=</span>';
+
+            this._textBox = new TextBox({});
+            this.addChild(this._textBox);
+            this._textBox.startup();
+
+            var del = new Button({
+                label: "X",
+                onClick: lang.hitch(this,'onDelete')
+            });
+            this.addChild(del);
+            del.startup();
+        },
+        _getValueAttr: function() {
+            return this._textBox.set('value');
+        },
+        _setValueAttr: function(value) {
+            this._textBox.set('value',value);
+        },
+        onDelete: function(){}
+    });
+
+    var MultipleChoiceInputEdit = declare([_WidgetBase, _Container], {
+        _codeInput: null,
+        _multipleInput: null,
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            this._codeInput = new TextBox({
+                title: "Code"
+            });
+            table.addChild(this._codeInput);
+            this._codeInput.startup();
+
+            this._multipleInput = new CheckBox({
+                title: "Allow multiple"
+            });
+            table.addChild(this._multipleInput);
+            this._multipleInput.startup();
+
+            var add = new Button({
+                label: "Add",
+                onClick: lang.hitch(this,'_addOption',"")
+            });
+            table.addChild(add);
+            add.startup();
+
+            this._optionsList = new OrderedList({
+                type: 'multipleChoiceOption',
+                withHandles: true,
+                _createAvatarNode: function(item){
+                    return domConstruct.create("div",{
+                        'class': 'dragAvatar',
+                        innerHTML: item
+                    });
+                },
+                _createListNode: function(item) {
+                    var w = new MCOptionItem();
+                    w.startup();
+                    w.set('value',item);
+                    w.on('delete',lang.hitch(this,function(){
+                        this._optionsList.removeItem(w);
+                    }));
+                    return w.domNode;
                 }
-                this.removeChild(this._editTable);
-                this.addChild(this._simpleTable);
-                this._simpleTable.layout();
-            },
-            setObject: function(object) {
-                if(object.contents) {
-                    lang.mixin(this._numberSpinner, object.contents);
-                    this._setupEditWidgets(object.contents);
-                }
-                else {
-                    //Create widgets with default values
-                    this._setupEditWidgets(this.getObject().contents);
-                }
-            },
-            _setupEditWidgets: function(contents) {
-                //Set up widgets which should appear once edit is pressed.
-                this._editWidgets = [];
-                this._editWidgets.push(new NumberSpinner( { field: "value", title: "Default value" }))
-                this._editWidgets.push(new NumberSpinner( { field: "smallDelta", title: "Increment size" }));
-                this._editWidgets.push(new NumberSpinner( { constraint: true, field: "max", title: "Maximum value" }));
-                this._editWidgets.push(new NumberSpinner( { constraint: true, field: "min", title: "Minimum value" }));
-                this._editWidgets.push(new TextBox ( { field: "invalidMessage", title: "Invalid message" }));
-                this._editWidgets.push(new TextBox ( { field: "title", title: "Label" }));
-                for (var widget in this._editWidgets) {
-                    var w = this._editWidgets[widget];
-                    if (w.constraint)
-                        w.set('value', contents.constraints[w.field]);
-                    else
-                        w.set('value', contents[w.field]);
-                    this._editTable.addChild(w);
-                }
-                this._editTable.startup();
-            },
-            getObject: function() {
-                return { 
-                    type: 'IntegerInput',
-                    contents: { 
-                        value: this._numberSpinner.value,
-                        smallDelta: this._numberSpinner.smallDelta,
-                        constraints: this._numberSpinner.constraints,
-                        invalidMessage: this._numberSpinner.invalidMessage,
-                        title: this._numberSpinner.title
-                    }
-                };
-            }
-        });
-
-        return factory;
-    });
+            });
+            table.addChild(this._optionsList);
+            this._optionsList.startup();
+
+            this.addChild(table);
+            table.startup();
+        },
+
+        _setValueAttr: function(value) {
+            this._codeInput.set('value', value.code || "");
+            this._multipleInput.set('checked', value.multiple);
+            this._optionsList.deleteItems();
+            this._optionsList.appendItems(value.items || []);
+        },
+        _getValueAttr: function() {
+            return {
+                type: "MultipleChoiceInput",
+                code: this._codeInput.get('value') || "",
+                multiple: this._multipleInput.get('checked'),
+                items: array.map(this._optionsList.getItems(),function(item){
+                    return item.get('value');
+                },this)
+            };
+        }
+    });
+
+    return factory;
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js	(revision 400)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js	(revision 402)
@@ -72,5 +72,5 @@
                 this.source.getAllNodes()
                 .forEach(function(node){
-                    registry.byNode(node).destroy();
+                    registry.byNode(node).destroyRecursive();
                 });
                 this.source.sync();
