Index: /Dev/branches/rest-dojo-ui/client/rft/run.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 377)
+++ /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 378)
@@ -42,6 +42,6 @@
     'rft/ui/Selector',
     'rft/ui/TitleGroup',
-    'rft/ui/PreviewWidgets/HeaderItem',
-    'rft/ui/PreviewWidgets/TextItem',
+    /*PreviewWidgets*/
+    'rft/ui/InnerWidgetFactory',
     // pages -> load dynamically?
     'rft/pages/index',
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js	(revision 378)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js	(revision 378)
@@ -0,0 +1,69 @@
+define(	['dojo', 'dijit'],
+	function(dojo, dijit) {
+		dojo.provide('rft.ui.InnerWidgetFactory');
+		dojo.provide('rft.ui.HeaderItem');
+		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();
+			}
+		});
+
+		/* 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' };
+			}
+		});
+	}
+)
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 377)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 378)
@@ -9,8 +9,7 @@
 	'dijit/_WidgetsInTemplateMixin',
 	'dijit/form/TextBox',
-	'rft/ui/PreviewWidgets/HeaderItem',
-	'rft/ui/PreviewWidgets/TextItem',
+	'rft/ui/InnerWidgetFactory',
 	'dojo/text!./templates/QuestionEditorPreviewItem.html',
-	], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, HeaderItem, TextItem, templateFull) {
+	], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, InnerWidgetFactory, templateFull) {
 		return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
 
@@ -42,10 +41,8 @@
 					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;
@@ -84,6 +81,5 @@
 			},
 			getContent: function() {
-				return { 	data: this.innerWidget.getContent(),
-							type: this.item.type };
+				return this.innerWidget.getObject();
 			},
 			removeObject: function(widget) {
@@ -93,4 +89,7 @@
 				// 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)({});" ?
+
+				this.innerWidget = new InnerWidgetFactory().createWidget( this.item );
+				/*
 				this.innerWidget = eval("new "+ this.item.type + "({ disabled: true });");
 				this.innerWidget.setContent(this.item.data);
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 377)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 378)
@@ -135,7 +135,5 @@
 					label: "Header",
 					objectData: {
-						_id: null,
-						type: "HeaderItem",
-						widgetProps: {}
+						widgetType: "Header",
 					},
 					icon: "Header"
@@ -144,7 +142,5 @@
 					label: "Text",
 					objectData: {
-						_id: null,
-						type: "TextItem",
-						widgetProps: {}
+						widgetType: "Text",
 					},
 					icon: "TextBox"
@@ -153,7 +149,5 @@
 					label: "Image",
 					objectData: {
-						_id: null,
-						widgetType: "rft.surveyContent.ImageDialog",
-						widgetProps: {}
+						widgetType: "Image",
 					},
 					icon: "Image"
@@ -162,7 +156,5 @@
 					label: "External media",
 					objectData: {
-						_id: null,
-						widgetType: "rft.surveyContent.ExternalDialog",
-						widgetProps: {}
+						widgetType: "ExternalMedia",
 					},
 					icon: "External"
@@ -171,7 +163,5 @@
 					label: "Divider",
 					objectData: {
-						_id: null,
-						widgetType: "rft.surveyContent.Divider",
-						widgetProps: {}
+						widgetType: "Divider",
 					},
 					icon: "Divider"
@@ -184,7 +174,5 @@
 					label: "Free text",
 					objectData: {
-						_id: null,
-						widgetType: "rft.surveyContent.TextInput",
-						widgetProps: {}
+						widgetType: "FreeTextInput",
 					},
 					icon: "Text"
@@ -194,5 +182,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.IntegerInput",
+						widgetType: "IntegerInput",
 						widgetProps: {}
 					},
@@ -203,5 +191,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.ScaleInput",
+						widgetType: "ScaleInput",
 						widgetProps: {}
 					},
@@ -212,5 +200,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.CardsInput",
+						widgetType: "CardsInput",
 						widgetProps: {}
 					},
@@ -221,5 +209,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.MultipleChoiceInput",
+						widgetType: "MultipleChoiceInput",
 						widgetProps: {}
 					},
