Index: Dev/branches/rest-dojo-ui/client/rft/css/layout.css
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/css/layout.css	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/css/layout.css	(revision 387)
@@ -278,8 +278,6 @@
 
 .claro .newline {
-    float: left;
-    clear: both;
-}
-
+    display: block;
+}
 
 /* Question editor/Survey Advanced editor */
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.html	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/question.html	(revision 387)
@@ -17,7 +17,5 @@
 		</div>
 		<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
-			<div id="QuestionEditorPreview">
-				
-			</div>
+			<div id="QuestionEditorPreview"></div>
 		</div>
 	</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 387)
@@ -1,19 +1,14 @@
-define(['dojo/_base/declare',
+define([
+    'dojo/_base/declare',
+    'dojo/_base/Deferred',
     'dojo/_base/lang',
-    'dojo/_base/event',
-    'dojo/_base/Deferred',
-    'rft/ui/LineWithActionsWidget',
+    'dojo/behavior',
+    'dijit/form/FilteringSelect',
     'rft/store',
+    'rft/content',
     'rft/ui/_Page',
-    'rft/api',
-    'rft/content',
-    'dijit/registry',
-    'dojo/on',
-    'dojo/behavior',
-    'dojo/query',
     'rft/ui/QuestionEditorPreview',
-    'rft/ui/QuestionEditorToolkit',
-    'dijit/form/FilteringSelect'],
-    function(declare, lang, event, Deferred, LineWithActionsWidget, store, _Page, api, content, registry, on, behavior, query){
+    'rft/ui/QuestionEditorToolkit'
+    ],function(declare, Deferred, lang, behavior, FilteringSelect, store, content, _Page, QuestionEditorPreview, QuestionEditorToolkit){
         return declare('rft.pages.question', [_Page], {
             question: null,
@@ -72,9 +67,11 @@
             },
             _setupEditor: function() {
-                this._toolkit = new rft.ui.QuestionEditorToolkit();
+                this._toolkit = new QuestionEditorToolkit();
                 this._toolkit.placeAt("QuestionEditorToolkit");
+                this._toolkit.startup();
 
-                this._preview = new rft.ui.QuestionEditorPreview();
+                this._preview = new QuestionEditorPreview();
                 this._preview.placeAt("QuestionEditorPreview");
+                this._preview.startup();
                 this._supportingWidgets.push(this._toolkit, this._preview);
             }
Index: Dev/branches/rest-dojo-ui/client/rft/ui/ContentWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/ContentWidgetFactory.js	(revision 387)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/ContentWidgetFactory.js	(revision 387)
@@ -0,0 +1,183 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang', 
+    'dijit/form/NumberSpinner',
+    'dijit/form/Textarea',
+    'dijit/form/TextBox',
+    'dijit/layout/StackContainer',
+    'dojox/form/CheckedMultiSelect',
+    'dojox/layout/TableContainer'
+    ],function(declare, lang, NumberSpinner, Textarea, TextBox, StackContainer, CheckedMultiSelect, TableContainer) {
+        var factory = declare('rft.ui.ContentWidgetFactory', [], {
+            /* No default type, all should be valid */
+            createWidget: function(/*Object*/ content) {
+                // options: Object
+                //            type: "header", "text", textinput, etc.
+                //            contents: "text"
+                //            disabled: bool
+                return this['create'+content.type+'Widget'](content);
+            },
+            createHeaderWidget: function(options) {
+                var headerWidget = new HeaderItem();
+                headerWidget.setObject(options);
+                return headerWidget;
+            },
+            createTextWidget: function(options) {
+                var textWidget = new TextItem();
+                textWidget.setObject(options);
+                return textWidget;
+            },
+            createFreeTextInputWidget: function(options) {
+                return new FreeTextInput();
+            },
+            createIntegerInputWidget: function(options) {
+                var integerWidget = new IntegerInput();
+                integerWidget.setObject(options);
+                return integerWidget;
+            },
+            createMultipleChoiceInputWidget: function(options) {
+                var mcWidget = new MultipleChoiceInput();
+                mcWidget.setObject(options);
+                return mcWidget;
+            }
+        });
+
+        /* Contents */
+        var HeaderItem = declare(TextBox, {
+            getObject: function() {
+                return { type : 'Header',
+                         contents: this.get('value'),
+                         disabled: this.get('disabled')
+                };
+            },
+            setObject: function(object) {
+                this.set('value', object.contents);
+                if (object.disabled) {
+                    this.set('disabled', true);
+                }
+            }
+        });
+
+        var TextItem = declare(Textarea, {
+            getObject: function() {
+                return { type: 'Text',
+                         contents: this.get('value'),
+                         disabled: this.get('disabled')
+                };
+            },
+            setObject: function(object) {
+                this.set('value', object.contents);
+                if (object.disabled) {
+                    this.set('disabled', true);
+                }
+            }    
+        });
+
+        /* Inputs */
+        var FreeTextInput = declare(Textarea, {
+            getObject: function() {
+                return { type: 'FreeTextInput' };
+            }
+        });
+
+        //Use CheckedMultiSelect
+        var MultipleChoiceInput = declare(StackContainer, {
+            _multiSelect: null,
+            postCreate: 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,
+            postCreate: 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);
+                    }
+                }
+                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;
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js	(revision 386)
+++ 	(revision )
@@ -1,184 +1,0 @@
-define(	[
-	'dojo', 
-	'dojo/_base/lang', 
-	'dijit', 
-	'dijit/layout/StackContainer',
-	'dojox/form/CheckedMultiSelect',
-	'dojox/layout/TableContainer',
-	'rft/ui/MultipleChoiceListView'],
-	function(dojo, lang, dijit, StackContainer, CheckedMultiSelect, TableContainer, ListView) {
-		dojo.provide('rft.ui.InnerWidgetFactory');
-		dojo.declare('rft.ui.InnerWidgetFactory', [],{
-			/* No default type, all should be valid */
-			createWidget: function(/*Object*/ options) {
-				// options: Object
-				//			type: "header", "text", textinput, etc.
-				//			contents: "text"
-				//			disabled: bool
-				return this['create'+options.widgetType+'Widget'](options);
-			},
-			createHeaderWidget: function(options) {
-				var headerWidget = new rft.ui.HeaderItem();
-				headerWidget.setObject(options);
-				return headerWidget;
-			},
-			createTextWidget: function(options) {
-				var textWidget = new rft.ui.TextItem();
-				textWidget.setObject(options);
-				return textWidget;
-			},
-			createFreeTextInputWidget: function(options) {
-				return new rft.ui.FreeTextInput();
-			},
-			createIntegerInputWidget: function(options) {
-				var integerWidget = new rft.ui.IntegerInput();
-				integerWidget.setObject(options);
-				return integerWidget;
-			},
-			createMultipleChoiceInputWidget: function(options) {
-				var mcWidget = new rft.ui.MultipleChoiceInput();
-				mcWidget.setObject(options);
-				return mcWidget;
-			}
-		});
-
-		/* Contents */
-		dojo.declare('rft.ui.HeaderItem', dijit.form.TextBox, {
-			getObject: function() {
-				return { widgetType : 'Header',
-						 contents: this.get('value'),
-						 disabled: this.get('disabled')
-				};
-			},
-			setObject: function(object) {
-				this.set('value', object.contents);
-				if (object.disabled) {
-					this.set('disabled', true);
-				}
-			}
-		});
-
-		dojo.declare('rft.ui.TextItem', dijit.form.Textarea, {
-			getObject: function() {
-				return { widgetType : 'Text',
-						 contents: this.get('value'),
-						 disabled: this.get('disabled')
-				};
-			},
-			setObject: function(object) {
-				this.set('value', object.contents);
-				if (object.disabled) {
-					this.set('disabled', true);
-				}
-			}	
-		});
-
-
-
-		/* Inputs */
-		dojo.declare('rft.ui.FreeTextInput', dijit.form.Textarea, {
-			getObject: function() {
-				return { widgetType: 'FreeTextInput' };
-			}
-		});
-
-		//Use CheckedMultiSelect
-		dojo.declare('rft.ui.MultipleChoiceInput',  StackContainer, {
-			_multiSelect: null,
-			postCreate: 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;
-			}
-
-		});
-
-		dojo.declare('rft.ui.IntegerInput', StackContainer, {
-			_numberSpinner:  null,
-			_simpleTable: null,
-			_editWidgets: null,
-			_editTable: null,
-			postCreate: function() {
-				this.inherited(arguments);
-				this._numberSpinner = new dijit.form.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 (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);
-					}
-				}
-				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 dijit.form.NumberSpinner( { field: "value", title: "Default value" }))
-				this._editWidgets.push(new dijit.form.NumberSpinner( { field: "smallDelta", title: "Increment size" }));
-				this._editWidgets.push(new dijit.form.NumberSpinner( { constraint: true, field: "max", title: "Maximum value" }));
-				this._editWidgets.push(new dijit.form.NumberSpinner( { constraint: true, field: "min", title: "Minimum value" }));
-				this._editWidgets.push(new dijit.form.TextBox ( { field: "invalidMessage", title: "Invalid message" }));
-				this._editWidgets.push(new dijit.form.TextBox ( { field: "title", title: "Label" }));
-				for (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 { 
-					widgetType: 'IntegerInput',
-					contents: { 
-					 	value: this._numberSpinner.value,
-					    smallDelta: this._numberSpinner.smallDelta,
-					 	constraints: this._numberSpinner.constraints,
-					 	invalidMessage: this._numberSpinner.invalidMessage,
-					 	title: this._numberSpinner.title
-					}
-				};
-			}
-		});
-	}
-)
Index: Dev/branches/rest-dojo-ui/client/rft/ui/List.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/List.js	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/List.js	(revision 387)
@@ -36,5 +36,4 @@
                 this.source = new Source(this.sourceNode, {
                     accept: [this.type],
-                    horizontal: false,
                     singular: true,
                     creator: lang.hitch(this, this._createNode)
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 387)
@@ -1,87 +1,65 @@
 define([
-	'dojo/_base/declare',
-	'dojo/_base/lang',
-	'dojo/_base/array',
-	'dijit/_WidgetBase',
-	'dijit/_Container',
-	'dojo/dom-construct',
-	'rft/ui/QuestionEditorPreviewItem',
-	'dijit/_TemplatedMixin',
-	'dijit/_WidgetsInTemplateMixin',
-	'dojo/text!./templates/QuestionEditorPreview.html'
-	], function(declare, lang, baseArray, _WidgetBase, _Container, domConstruct, QuestionEditorPreviewItem, _TemplatedMixin, _WidgetsInTemplateMixin, template) {
-		return declare("rft.ui.QuestionEditorPreview", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dnd/Source',
+    'dojo/dom-construct',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'rft/ui/QuestionEditorPreviewItem',
+    'dojo/text!./templates/QuestionEditorPreview.html'
+    ], function(declare, lang, Source, domConstruct, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, QuestionEditorPreviewItem, template) {
+        return declare("rft.ui.QuestionEditorPreview", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
 
-			templateString: template,
-			dndSource: null,
+            templateString: template,
+            dndSource: null,
 
-			postCreate: function(){
-				this.dndSource = new dojo.dnd.Source(this.dndSourceNode, {
-					isSource: true,
-					//accept: ["ToolkitItem", "PreviewItem"],
-					horizontal: false,
-					withHandles: false,
-					copyOnly: false,
-					selfCopy: false,
-					selfAccept: true,
-					delay: 0,
-					skipForm: true,
-					creator: lang.hitch(this, this._sourceCreatorMethod)
-				});
-				this.dndSource.startup();
-			},
-			_sourceCreatorMethod: function(item, hint){
-				var node;
-				switch(hint){
-					
-					case "avatar":
-					node = document.createElement("span");
-					node.innerHTML = item.item.data || "Dragging!!!";
-					return {node: node, data: item, type: "PreviewItem"};
-					break;
-					
-					default:
-					var previewItem = new rft.ui.QuestionEditorPreviewItem({
-						item: item
-					});
-					return {node: previewItem.domNode, data: previewItem, type: item.type};
-					break;					
-				}				
-			},
-			_createInnerWidget: function(item) {
-				var innerWidget;
-				switch (item.widgetType) {
-					default:
-					innerWidget = new dijit.form.Button({});
-					break;
-				}
+            postCreate: function(){
+                this.inherited(arguments);
+                this.dndSource = new Source(this.dndSourceNode, {
+                    accept: ["questionContent"],
+                    skipForm: true,
+                    creator: lang.hitch(this, this._sourceCreatorMethod)
+                });
+                this.dndSource.startup();
+            },
+            _sourceCreatorMethod: function(item, hint){
+                var node;
+                switch(hint){
+                case "avatar":
+                    node = domConstruct.create("span",{
+                        innerHTML: item.type || "Dragging!!!"
+                    });
+                default:
+                    var previewItem = new QuestionEditorPreviewItem({
+                        item: item.content
+                    });
+                    node = previewItem.domNode;
+                }                
+                return {node: node, data: item, type: ["questionContent"]};
+            },
+            insertObjects: function(/*Array*/items) {
+                this.dndSource.insertNodes(false, items);
+            },
+            getContent: function() {
+                var content = [];
+                var nodes = this.dndSource.getAllNodes();
+                for (var i = 0; i < nodes.length; i++) {
+                    content.push(this.dndSource.getItem(nodes[i].id).data.getContent());
+                }
+                return content;
+            },
+            getNodeList: function() {
+                return this.dndSource.getAllNodes();
+            },
+            onDropInternal: function() {
+                topic.publish("/QuestionEditor/Preview/MoveItem");
+            },
+            onDropExternal: function() {
+                // This is fired when something from the Toolkit is dropped into the Preview -- add operation.
+                topic.publish("/QuestionEditor/Preview/AddItem");
+            }
 
-				return innerWidget;
-			},
-			insertObjects: function(/*Array*/objects) {
-				// This takes an array of objects {data:{//props}, type:[//types]}. Node is NOT included!
-				objects.forEach(function(item){
-					this.dndSource.insertNodes(false, [item]);
-				}, this);
-			},
-			getContent: function() {
-				content = [];
-				var nodes = this.dndSource.getAllNodes();
-				for (var i = 0; i < nodes.length; i++) {
-					content.push(this.dndSource.getItem(nodes[i].id).data.getContent());
-				}
-				return content;
-			},
-			getNodeList: function() {
-				return this.dndSource.getAllNodes();
-			},
-			onDropInternal: function() {
-				topic.publish("/QuestionEditor/Preview/MoveItem");
-			},
-			onDropExternal: function() {
-				// This is fired when something from the Toolkit is dropped into the Preview -- add operation.
-				topic.publish("/QuestionEditor/Preview/AddItem");
-			}
-
-		});
-});
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 387)
@@ -1,111 +1,97 @@
 define([
-	'dojo/_base/declare',
-	'dojo/_base/fx',
-	'dijit/_WidgetBase',
-	'dojo/dom-class',
-	'dojo/_base/lang',
-	'dojo/on',
-	'dijit/_TemplatedMixin',
-	'dijit/_WidgetsInTemplateMixin',
-	'dijit/form/TextBox',
-	'rft/ui/InnerWidgetFactory',
-	'dojo/text!./templates/QuestionEditorPreviewItem.html',
-	], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, InnerWidgetFactory, templateFull) {
-		return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
+    'dojo/_base/declare',
+    'dojo/_base/fx',
+    'dojo/_base/lang',
+    'dojo/dom-class',
+    'dojo/on',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'rft/ui/ContentWidgetFactory',
+    'dojo/text!./templates/QuestionEditorPreviewItem.html',
+    ], function(declare, fx, lang, domClass, on, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, ContentWidgetFactory, template) {
+        return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
 
-			version: "full",
-			templateString: templateFull,
-			baseClass: "surveyEditorPreviewItem",
-			previousContentHeight: 200,
-			innerWidget: null,
-			foldDuration: [250, 250],
-			animation: null,
-			_editing: false,
+            version: "full",
+            templateString: template,
+            baseClass: "surveyEditorPreviewItem",
+            previousContentHeight: 200,
+            innerWidget: null,
+            foldDuration: [250, 250],
+            animation: null,
+            _editing: false,
 
-			postCreate: function() {
-				this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
-				this.removeButtonNode.onClick = lang.hitch(this, this.removeObject);
-				this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
-				if (this.item) {
-					this._createInnerWidget();
-				} else {
-					throw "No data supplied to create an innerWidget off of!";
-				}
+            postCreate: function() {
+                this.inherited(arguments);
+                this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
+                this.removeButtonNode.onClick = lang.hitch(this, this.removeObject);
+                this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
+                if (this.item) {
+                    this._createInnerWidget();
+                } else {
+                    throw "No data supplied to create an innerWidget off of!";
+                }
 
-				on(this.innerWidget, "onSetTitle", function(title) {
-					this.titleNode.innerHTML = title;
-				});
-			},
-			toggleEdit: function() {
-				if(this._editing) {
-					this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
-					this.editButtonNode.set("label", "Edit");
-					this.innerWidget.save();
-				}
-				else {
-					this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
-					this.editButtonNode.set("label", "Save");
-					this.innerWidget.edit();
-				}
-				this._editing = !this._editing;
-			},
-			toggleFold: function() {
-				if (!this.animation) {
-					if (!domClass.contains(this.domNode, "fold")) {
-						this.previousContentHeight = dojo.marginBox(this.innerNode).h;
-						this.animation = fx.animateProperty({
-							node: this.innerNode,
-							duration: this.foldDuration[0],
-							properties: {
-								height: 1						
-							},
-							onEnd: lang.hitch(this, function(){
-								domClass.add(this.domNode, "fold");
-								this.animation = null;
-							})
-						}).play();
-						this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
-					} else {
-						this.animation = fx.animateProperty({
-							node: this.innerNode,
-							duration: this.foldDuration[1],
-							properties: {
-								height: this.previousContentHeight				
-							},
-							onEnd: lang.hitch(this, function(){
-								domClass.remove(this.domNode, "fold");
-								this.animation = null;
-							})
-						}).play();
-						this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
-					}
-				}
-			},
-			getContent: function() {
-				return this.innerWidget.getObject();
-			},
-			removeObject: function(widget) {
-				this.destroyRecursive();
-			},
-			_createInnerWidget: function() {
-				// This always creates a textbox as innerwidget pending creation of actual innerWidgets.
-				// Introduce a better way to create these widgets than a switch statement, based on item.widgetType? Perhaps "new eval(item.widgetType)({});" ?
+                on(this.innerWidget, "onSetTitle", function(title) {
+                    this.titleNode.innerHTML = title;
+                });
+            },
+            toggleEdit: function() {
+                if(this._editing) {
+                    this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
+                    this.editButtonNode.set("label", "Edit");
+                    this.innerWidget.save();
+                }
+                else {
+                    this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
+                    this.editButtonNode.set("label", "Save");
+                    this.innerWidget.edit();
+                }
+                this._editing = !this._editing;
+            },
+            toggleFold: function() {
+                if (!this.animation) {
+                    if (!domClass.contains(this.domNode, "fold")) {
+                        this.previousContentHeight = dojo.marginBox(this.innerNode).h;
+                        this.animation = fx.animateProperty({
+                            node: this.innerNode,
+                            duration: this.foldDuration[0],
+                            properties: {
+                                height: 1                        
+                            },
+                            onEnd: lang.hitch(this, function(){
+                                domClass.add(this.domNode, "fold");
+                                this.animation = null;
+                            })
+                        }).play();
+                        this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
+                    } else {
+                        this.animation = fx.animateProperty({
+                            node: this.innerNode,
+                            duration: this.foldDuration[1],
+                            properties: {
+                                height: this.previousContentHeight                
+                            },
+                            onEnd: lang.hitch(this, function(){
+                                domClass.remove(this.domNode, "fold");
+                                this.animation = null;
+                            })
+                        }).play();
+                        this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
+                    }
+                }
+            },
+            getContent: function() {
+                return this.innerWidget.getObject();
+            },
+            removeObject: function(evt) {
+                this.destroyRecursive();
+            },
+            _createInnerWidget: function() {
+                this.innerWidget = new ContentWidgetFactory().createWidget( this.item );
+                this.innerWidget.placeAt(this.containerNode);
+                this.innerWidget.startup();
+            }
 
-				this.innerWidget = new InnerWidgetFactory().createWidget( this.item );
-				/*
-				this.innerWidget = eval("new "+ this.item.type + "({ disabled: true });");
-				this.innerWidget.setContent(this.item.data);
-				this.titleNode.innerHTML = this.item.type;
-				/*
-				switch (this.item.widgetType) {
-					default:
-					this.innerWidget = new HeaderItem({ disabled: true });
-					this.titleNode.innerHTML = "Header";
-					break;
-				}*/
-				this.innerWidget.startup();
-				this.innerWidget.placeAt(this.containerNode);
-			}
-
-		});
-});
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 386)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 387)
@@ -1,219 +1,186 @@
 define([
-	'dojo/_base/declare',
-	'dojo/_base/lang',
-	'dojo/_base/array',
-	'dijit/_WidgetBase',
-	'dijit/_Container',
-	'dojo/dom-construct',
-	'rft/store',
-	'rft/ui/QuestionEditorPreviewItem',
-	'rft/ui/CategoryListView',
-	'dijit/_TemplatedMixin',
-	'dijit/_WidgetsInTemplateMixin',
-	'dijit/form/ComboBox',
-	'dojo/text!./templates/QuestionEditorToolkit.html'
-	], function(declare, lang, baseArray, _WidgetBase, _Container, domConstruct, store, QuestionEditorPreviewItem, CategoryListView, _TemplatedMixin, _WidgetsInTemplateMixin, ComboBox, template) {
-		return declare("rft.ui.QuestionEditorToolkit", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dnd/Source',
+    'dojo/dom-construct',
+    'dojo/store/Memory',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'dijit/form/Button',
+    'dijit/form/ComboBox',
+    'rft/store',
+    'rft/ui/CategoryListView',
+    'dojo/text!./templates/QuestionEditorToolkit.html'
+    ], function(declare, lang, Source, domConstruct, Memory, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, store, CategoryListView, template) {
+        return declare("rft.ui.QuestionEditorToolkit", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
 
-			templateString: template,
-			_list: null,
-			_categorySelect: null,
-			_categoryStore: null,
-			_topicSelect: null,
-			_topicStore: null,
-			_categories : null,
+            templateString: template,
+            _list: null,
+            _categorySelect: null,
+            _categoryStore: null,
+            _topicSelect: null,
+            _topicStore: null,
+            _categories : null,
 
-//			constructor: function() {
-//				lang.mixin(this, arguments);
-//			},
+            _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"
+                }],
 
-			postCreate: function(){
-				this.contentSource = new dojo.dnd.Source(this.ToolkitContentSourceNode, {
-					accept: [],
-					horizontal: false,
-					withHandles: false,
-					copyOnly: true,
-					selfCopy: false,
-					selfAccept: false,
-					singular: true,
-					creator: this._creator
-				});
-				this.inputsSource = new dojo.dnd.Source(this.ToolkitInputsSourceNode, {
-					accept: [],
-					horizontal: false,
-					withHandles: false,
-					copyOnly: true,
-					selfCopy: false,
-					selfAccept: false,
-					singular: true,
-					creator: this._creator
-				});
-				var contentItems = this._contentItems();
-				var inputsItems = this._inputsItems();
-				this.contentSource.insertNodes(false, contentItems);
-				this.inputsSource.insertNodes(false, inputsItems);
-			},
-			loadQuestion: function(question) {
-				this.propertiesForm.set('value', question);
-				this._categories = question.categories;
-				this._setupListView();
-				this._setupCategories();
-				this._setupTopic(question.topic);
-			},
-			onCategoryAdd: function() {
-				this._addCategory(this._categorySelect.get('displayedValue')); 
-				this._categorySelect.reset();
-			},
-			_creator: function(item, hint) {
-				var node;
-				if (hint == "avatar") {
-					node = document.createElement("span");
-					node.innerHTML = item.widgetType;
-					return {node: node, data: item, type: "ToolkitItem"};
-				} else {
-					var w = new dijit.form.Button({
-						baseClass: "rftLargeButton",
-						iconClass: "rftIcon rftIcon"+item.icon,
-						label: item.label,
-						showLabel: true,
-						class: "newline"
-					});
-					return {node: w.domNode, data: item.objectData, type: "ToolkitItem"};
-				}
-			},
-			_setupListView: function() {
-				this._list = new CategoryListView( {
-					removeCallback: lang.hitch(this, this._removeCategory)
-				}).placeAt(this.listNode);
-				for (var category in this._categories) {
-					this._list.appendItem(this._categories[category]);
-				}	
-				this._list.startup();
-			},
-			_setupCategories: function() {
-				this._categoryStore = new dojo.store.Memory({data: [] });
-				store.query("_design/default/_view/questions", {reduce:true, group:false, group_level:1})
-					.forPairs(lang.hitch(this, function(value, key) {
-						this._categoryStore.put({ id: key[0] });
-					}));
-				this._categorySelect = new ComboBox( {
-					id: "categoriesBox",
-					name: "categories",
-					store: this._categoryStore,
-					searchAttr: "id"
-				}, "categoriesBox");
-				this._supportingWidgets.push(this._categorySelect);
+            postCreate: function(){
+                this.inherited(arguments);
+                this.contentSource = new Source(this.ToolkitContentSourceNode, {
+                    accept: [],
+                    copyOnly: true,
+                    selfAccept: false,
+                    singular: true,
+                    creator: this._creator
+                });
+                this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
+                    accept: [],
+                    copyOnly: true,
+                    selfAccept: false,
+                    singular: true,
+                    creator: this._creator
+                });
+                this.contentSource.insertNodes(false, this._contentItems);
+                this.inputsSource.insertNodes(false, this._inputsItems);
+            },
+            loadQuestion: function(question) {
+                this.propertiesForm.set('value', question);
+                this._categories = question.categories;
+                this._setupListView();
+                this._setupCategories();
+                this._setupTopic(question.topic);
+            },
+            onCategoryAdd: function() {
+                this._addCategory(this._categorySelect.get('displayedValue')); 
+                this._categorySelect.reset();
+            },
+            _creator: function(item, hint) {
+                var node;
+                if (hint == "avatar") {
+                    node = domConstruct.create('span',{
+                        innerHTML: item.label
+                    });
+                } else {
+                    var w = new Button({
+                        baseClass: "rftLargeButton",
+                        iconClass: "rftIcon rftIcon"+item.icon,
+                        label: item.label,
+                        showLabel: true,
+                        'class': "newline"
+                    });
+                    node = w.domNode;
+                }
+                return {node: node, data: item, type: ["questionContent"]};
+            },
+            _setupListView: function() {
+                this._list = new CategoryListView( {
+                    removeCallback: lang.hitch(this, this._removeCategory)
+                }).placeAt(this.listNode);
+                for (var category in this._categories) {
+                    this._list.appendItem(this._categories[category]);
+                }    
+                this._list.startup();
+            },
+            _setupCategories: function() {
+                this._categoryStore = new Memory({data: [] });
+                store.query("_design/default/_view/questions", {reduce:true, group:false, group_level:1})
+                .forPairs(lang.hitch(this, function(value, key) {
+                    this._categoryStore.put({ id: key[0] });
+                }));
+                this._categorySelect = new ComboBox( {
+                    id: "categoriesBox",
+                    name: "categories",
+                    store: this._categoryStore,
+                    searchAttr: "id"
+                }, "categoriesBox");
+                this._supportingWidgets.push(this._categorySelect);
 
             },
             _setupTopic: function(topic) {
-				this._topicStore = new dojo.store.Memory( {data: [] });
-				store.query("_design/default/_view/topics", {reduce:true, group:true})
-					.forPairs(lang.hitch(this, function(value, key) {
-						this._topicStore.put({ id: key });
-					}));
-				this._topicSelect = new ComboBox( {
-					id: "topicBox",
-					name: "topic",
-					store: this._topicStore,
-					searchAttr: "id",
-					value: topic
-				}, "topicBox");
-				this._supportingWidgets.push(this._topicSelect);
+                this._topicStore = new Memory( {data: [] });
+                store.query("_design/default/_view/topics", {reduce:true, group:true})
+                .forPairs(lang.hitch(this, function(value, key) {
+                    this._topicStore.put({ id: key });
+                }));
+                this._topicSelect = new ComboBox( {
+                    id: "topicBox",
+                    name: "topic",
+                    store: this._topicStore,
+                    searchAttr: "id",
+                    value: topic
+                }, "topicBox");
+                this._supportingWidgets.push(this._topicSelect);
             },
-			_addCategory: function(item) {
-				this._categories.push(item);
-				this._list.appendItem(item);
-			},
-			_removeCategory: function(item) {
-				this._categories.splice(this._categories.indexOf(item), 1);
-			},
-			_contentItems: function() {
-				// Returns an array of objects, from which to generate buttons to populate the ToolkitContentSource list.
-				return [
-				{
-					label: "Header",
-					objectData: {
-						widgetType: "Header",
-					},
-					icon: "Header"
-				},
-				{
-					label: "Text",
-					objectData: {
-						widgetType: "Text",
-					},
-					icon: "TextBox"
-				},
-				{
-					label: "Image",
-					objectData: {
-						widgetType: "Image",
-					},
-					icon: "Image"
-				},
-				{
-					label: "External media",
-					objectData: {
-						widgetType: "ExternalMedia",
-					},
-					icon: "External"
-				},
-				{
-					label: "Divider",
-					objectData: {
-						widgetType: "Divider",
-					},
-					icon: "Divider"
-				}];
-			},
-			_inputsItems: function() {
-				// Returns an array of objects, from which to generate buttons to populate the ToolkitInputsSource list.
-				return [
-				{
-					label: "Free text",
-					objectData: {
-						widgetType: "FreeTextInput",
-					},
-					icon: "Text"
-				},
-				{
-					label: "Integer",
-					objectData: {
-						_id: null,
-						widgetType: "IntegerInput",
-						widgetProps: {}
-					},
-					icon: "Integer"
-				},
-				{
-					label: "Scale",
-					objectData: {
-						_id: null,
-						widgetType: "ScaleInput",
-						widgetProps: {}
-					},
-					icon: "Scale"
-				},
-				{
-					label: "Cards",
-					objectData: {
-						_id: null,
-						widgetType: "CardsInput",
-						widgetProps: {}
-					},
-					icon: "Cards"
-				},
-				{
-					label: "Multiple Choice",
-					objectData: {
-						_id: null,
-						widgetType: "MultipleChoiceInput",
-						widgetProps: {}
-					},
-					icon: "MultipleChoice"
-				}
-				];
-			}
+            _addCategory: function(item) {
+                this._categories.push(item);
+                this._list.appendItem(item);
+            },
+            _removeCategory: function(item) {
+                this._categories.splice(this._categories.indexOf(item), 1);
+            }
 
-		});
-});
+        });
+    });
