Index: /Dev/branches/rest-dojo-ui/client/rft/pages/question.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 376)
@@ -39,8 +39,10 @@
             _refresh: function () {
                 this._toolkit.loadQuestion(this.question);
+                this._preview.insertObjects(this.question.content || []);
             },
             _onSave: function() {
                 lang.mixin(this.question, this._toolkit.propertiesForm.get('value'));
                 this.question.categories = this._toolkit._categories; 
+                this.question.content = this._preview.getContent();
                 store.put(this.question)
                 .then(function() {
@@ -50,5 +52,4 @@
             },
             _onDiscard: function() {
-                this._toolkit.propertiesForm.reset();
                 content.goTo('questions');
                 return false;
@@ -71,5 +72,4 @@
             },
             _setupEditor: function() {
-//                this.toolkit = new rft.ui.QuestionEditorToolkit( { question: this.question } );
                 this._toolkit = new rft.ui.QuestionEditorToolkit();
                 this._toolkit.placeAt("QuestionEditorToolkit");
Index: /Dev/branches/rest-dojo-ui/client/rft/run.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 376)
@@ -42,5 +42,6 @@
     'rft/ui/Selector',
     'rft/ui/TitleGroup',
-    
+    'rft/ui/PreviewWidgets/HeaderItem',
+    'rft/ui/PreviewWidgets/TextItem',
     // pages -> load dynamically?
     'rft/pages/index',
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/HeaderItem.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/HeaderItem.js	(revision 376)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/HeaderItem.js	(revision 376)
@@ -0,0 +1,20 @@
+define(["dojo", "dijit"],
+	function(dojo, dijit) {
+		dojo.provide("rft.ui.PreviewWidgets.HeaderItem");
+		dojo.require("dijit.form.TextBox");
+
+		dojo.declare("rft.ui.PreviewWidgets.HeaderItem", dijit.form.TextBox, {
+			edit: function() {
+				this.set('disabled', false);
+			},
+			save: function() {
+				this.set('disabled', true);
+			},
+			getContent: function() {
+				return this.get('value');
+			},
+			setContent: function(content) {
+				this.set('value', content);
+			}
+		});
+})
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/TextItem.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/TextItem.js	(revision 376)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/PreviewWidgets/TextItem.js	(revision 376)
@@ -0,0 +1,20 @@
+define(["dojo", "dijit"],
+	function(dojo, dijit) {
+		dojo.provide("rft.ui.PreviewWidgets.TextItem");
+		dojo.require("dijit.form.TextBox");
+
+		dojo.declare("rft.ui.PreviewWidgets.TextItem", dijit.form.Textarea, {
+			edit: function() {
+				this.set('disabled', false);
+			},
+			save: function() {
+				this.set('disabled', true);
+			},
+			getContent: function() {
+				return this.get('value');
+			},
+			setContent: function(content) {
+				this.set('value', content);
+			}
+		});
+})
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 376)
@@ -45,5 +45,5 @@
 						item: item
 					});
-					return {node: previewItem.domNode, data: item, type: "PreviewItem"};
+					return {node: previewItem.domNode, data: previewItem, type: item.type};
 					break;					
 				}				
@@ -59,5 +59,5 @@
 				return innerWidget;
 			},
-			InsertObjects: function(/*Array*/objects) {
+			insertObjects: function(/*Array*/objects) {
 				// This takes an array of objects {data:{//props}, type:[//types]}. Node is NOT included!
 				objects.forEach(function(item){
@@ -65,7 +65,13 @@
 				}, this);
 			},
-			RemoveObject: function(widget) {
+			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() {
+			getNodeList: function() {
 				return this.dndSource.getAllNodes();
 			},
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 376)
@@ -9,6 +9,8 @@
 	'dijit/_WidgetsInTemplateMixin',
 	'dijit/form/TextBox',
+	'rft/ui/PreviewWidgets/HeaderItem',
+	'rft/ui/PreviewWidgets/TextItem',
 	'dojo/text!./templates/QuestionEditorPreviewItem.html',
-	], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, templateFull) {
+	], function(declare, fx, _WidgetBase, domClass, lang, on, _TemplatedMixin, _WidgetsInTemplateMixin, TextBox, HeaderItem, TextItem, templateFull) {
 		return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
 
@@ -20,7 +22,10 @@
 			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();
@@ -32,4 +37,17 @@
 					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() {
@@ -65,12 +83,24 @@
 				}
 			},
+			getContent: function() {
+				return { 	data: this.innerWidget.getContent(),
+							type: this.item.type };
+			},
+			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)({});" ?
+				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 TextBox();
+					this.innerWidget = new HeaderItem({ disabled: true });
+					this.titleNode.innerHTML = "Header";
 					break;
-				}
+				}*/
 				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 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 376)
@@ -134,5 +134,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.HeaderDialog",
+						type: "HeaderItem",
 						widgetProps: {}
 					},
@@ -143,5 +143,5 @@
 					objectData: {
 						_id: null,
-						widgetType: "rft.surveyContent.TextDialog",
+						type: "TextItem",
 						widgetProps: {}
 					},
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html	(revision 375)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html	(revision 376)
@@ -4,5 +4,5 @@
 		<span class="floatRight">
 			<button class="blue" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconHalfArrowUp'" data-dojo-attach-point="foldButtonNode">Fold</button>
-			<button class="blue" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
+			<button class="blue" data-dojo-type="dijit.form.Button" data-dojo-attach-point="removeButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
 		</span>
 	</div>
@@ -15,5 +15,5 @@
 	<div class="bottomBorder inheritBgColor light" data-dojo-attach-point="bottomBorderNode">
 		<span class="floatRight">
-			<button class="trans" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
+			<button class="trans" data-dojo-type="dijit.form.Button" data-dojo-attach-point="editButtonNode" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
 		</span>
 	</div>
