Index: /Dev/branches/rest-dojo-ui/client/index.html
===================================================================
--- /Dev/branches/rest-dojo-ui/client/index.html	(revision 280)
+++ /Dev/branches/rest-dojo-ui/client/index.html	(revision 281)
@@ -4,9 +4,9 @@
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Research Facilitator Tool</title>
-        <link type="text/css" href="dijit/themes/claro/claro.css" rel="stylesheet" />
-        <link type="text/css" href="dojox/grid/resources/Grid.css" rel="stylesheet" />
-        <link type="text/css" href="dojox/grid/resources/claroGrid.css" rel="stylesheet" />
+        <link type="text/css" href="dojotoolkit/dijit/themes/claro/claro.css" rel="stylesheet" />
+        <link type="text/css" href="dojotoolkit/dojox/grid/resources/Grid.css" rel="stylesheet" />
+        <link type="text/css" href="dojotoolkit/dojox/grid/resources/claroGrid.css" rel="stylesheet" />
         <link type="text/css" href="rft/css/main.css" rel="stylesheet" />
-        <script type="text/javascript" src="dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: false, tlmSiblingOfDojo: false, isDebug: true, baseUrl: '', packages: ['dojo','dijit', 'dojox', 'rft']"></script>
+        <script type="text/javascript" src="dojotoolkit/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: false, tlmSiblingOfDojo: false, isDebug: true, baseUrl: '', packagePaths: {'dojotoolkit':['dojo','dijit', 'dojox'], '.':['rft']}"></script>
         <script type="text/javascript" src="rft/run.js"></script>
     </head>
Index: /Dev/branches/rest-dojo-ui/client/rft/css/main.css
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/css/main.css	(revision 280)
+++ /Dev/branches/rest-dojo-ui/client/rft/css/main.css	(revision 281)
@@ -1,2 +1,7 @@
+html,body {
+    width: 100%;
+    height: 100%;
+}
+
 .mainHeader {
     display: inline-block;
Index: /Dev/branches/rest-dojo-ui/client/rft/pages/questions.html
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/pages/questions.html	(revision 280)
+++ /Dev/branches/rest-dojo-ui/client/rft/pages/questions.html	(revision 281)
@@ -2,5 +2,5 @@
     <h1>Questions</h1>
     <div data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onNewQuestion">New question</div>
-    <div data-dojo-type="dijit.layout.AccordionContainer" data-dojo-props="doLayout: false" style="width: 100%; height: 100%;" data-rft-attach-point="accordion">
+    <div data-dojo-type="rft.ui.TitleGroup" data-rft-attach-point="accordion">
     </div>
     <div data-dojo-type="dijit.Dialog" title="Question" data-rft-attach-point="questionDialog">
@@ -17,4 +17,7 @@
                 <input data-dojo-type="dijit.form.TextBox" name="category" type="text" class="loginInput" />
             </fieldset>
+            <fieldset>
+                <div data-dojo-type="rft.ui.QuestionWidget" data-rft-attach-point="questionWidget" ></div>
+            </fieldset>
             <div style="float: right;">
                 <button type="button" data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onCancelQuestion">Cancel</button>
Index: /Dev/branches/rest-dojo-ui/client/rft/pages/questions.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 280)
+++ /Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 281)
@@ -1,10 +1,9 @@
 define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/array','dojo/_base/event',
-    'dojo/_base/Deferred','dojo/store/JsonRest','dijit/layout/ContentPane',
+    'dojo/_base/Deferred','dojo/store/JsonRest','dijit/layout/ContentPane','dijit/TitlePane',
     'rft/ui/_Page','rft/ui/LineWithActionsWidget'],
-    function(declare,lang,array,event,Deferred,JsonRest,ContentPane,_Page,LineWithActionsWidget) {
+    function(declare,lang,array,event,Deferred,JsonRest,ContentPane,TitlePane,_Page,LineWithActionsWidget) {
         return declare('rft.pages.questions',[_Page],{
             constructor: function() {
                 this.inherited(arguments);
-                this.containers = {};
                 this.questions = {};
             },
@@ -20,20 +19,4 @@
                     array.forEach(results,lang.hitch(this,'_addQuestion'));
                 }));
-            },
-            _getContainerForQuestion: function(q) {
-                var category = q.category || 'Unsorted';
-                var categoryContainer = this.containers[category];
-                if ( !categoryContainer ) {
-                    var ac = new ContentPane({
-                        title:category,
-                        doLayout: false
-                    });
-                    categoryContainer = this.containers[category] = {
-                        container: ac
-                    };
-                    ac.placeAt(this.accordion);
-                    ac.startup();
-                }
-                return categoryContainer.container;
             },
             _addQuestion: function(q) {
@@ -62,4 +45,37 @@
                 var container = this._getContainerForQuestion(q);
                 question.widget.placeAt(container.containerNode);
+                this._cleanupEmptyContainers();
+            },
+            _getContainerForQuestion: function(q) {
+                var category = q.category || 'Unsorted';
+                var widgets = this.accordion.getChildren();
+                var containerWidget;
+                var lastIndex = 'last';
+                array.some(widgets,lang.hitch(this,function(widget,idx) {
+                    if ( widget.title == category ) {
+                        containerWidget = widget;
+                        return true;
+                    } else if ( widget.title > category  ) {
+                        lastIndex = idx;
+                        return true;
+                    }
+                    return false;
+                }));
+                if ( !containerWidget ) {
+                    containerWidget = new TitlePane({
+                        title:category
+                    });
+                    containerWidget.startup();
+                    this.accordion.addChild(containerWidget,lastIndex);
+                }
+                return containerWidget;
+            },
+            _cleanupEmptyContainers: function() {
+                var widgets = this.accordion.getChildren();
+                array.forEach(widgets,lang.hitch(this,function(widget){
+                    if ( !widget.getChildren().length ) {
+                        this.accordion.removeChild(widget).destroy();
+                    }
+                }));
             },
             onNewQuestion: function() {
@@ -72,8 +88,11 @@
                 this.questionForm.reset();
                 this.questionForm.set('value',question);
+                this.questionWidget.set('value',question);
                 this.questionDialog.show();
             },
             onSaveQuestion: function(evt) {
                 var value = this.questionForm.get('value');
+                var subvalue = this.questionWidget.get('value');
+                lang.mixin(value,subvalue);
                 Deferred.when( this._store.put(value) )
                 .then(lang.hitch(this,function(){
@@ -88,5 +107,4 @@
                 this.questionDialog.hide();
                 this.questionForm.reset();
-                this._refresh();
             }
         });
Index: /Dev/branches/rest-dojo-ui/client/rft/run.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 280)
+++ /Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 281)
@@ -1,20 +1,26 @@
 require([
+    'dojo/data/ObjectStore',
+    'dojo/store/JsonRest',
+    'dijit/MenuBar',
+    'dijit/MenuBarItem',
+    'dijit/PopupMenuBarItem',
+    'dijit/DropDownMenu',
+    'dijit/TitlePane',
+    'dijit/layout/ContentPane',
+    'dijit/layout/TabContainer',
+    'dijit/layout/AccordionContainer',
     'dijit/form/Form',
     'dijit/form/TextBox',
     'dijit/form/Button',
     'dijit/form/Textarea',
-    'dojo/store/JsonRest',
-    'dojo/data/ObjectStore',
+    'dijit/form/ComboBox',
+    'dijit/form/Select',
     'dojox/grid/DataGrid',
-    'dijit/layout/ContentPane',
-    'dijit/layout/TabContainer',
-    'dijit/layout/AccordionContainer',
-    'dijit/MenuBar',
-    'dijit/MenuBarItem',
-    'dijit/PopupMenuBarItem',
-    'dijit/DropDownMenu',
+    'dojox/widget/TitleGroup',
     'rft/ui/MenuBarLink',
     'rft/ui/MenuLink',
     'rft/ui/LineWithActionsWidget',
+    'rft/ui/QuestionWidget',
+    'rft/ui/TitleGroup',
     'rft/pages/questions' // could this be done dynamically?
 ]);
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.html
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.html	(revision 281)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.html	(revision 281)
@@ -0,0 +1,11 @@
+<div>
+    <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="ourForm">
+        <select data-dojo-type="dijit.form.Select" data-dojo-attach-point="typeSelector" name="type">
+            <option value="string" selected>String</option>
+            <option value="text">Text</option>
+            <option value="multipleChoice">Multiple choice</option>
+        </select>
+        <div data-dojo-attach-point="typeDetails">
+        </div>
+    </form>
+</div>
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js	(revision 281)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js	(revision 281)
@@ -0,0 +1,45 @@
+require(['dojo/_base/declare','dijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dojo/text!rft/ui/QuestionWidget.html','dijit/form/TextBox'],
+    function(declare,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString,TextBox){
+        declare('rft.ui.QuestionWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+            templateString: templateString,
+            mode: 'view', // view || edit
+            type: 'string',
+            _w: null,
+            postCreate: function() {
+                this._setType(this.type);
+            },
+            _setType: function(type) {
+                if ( !this._w || this.type != type ) {
+                    if ( this._w ) {
+                        this._w.destroy();
+                        this._w = null;
+                    }
+                    this.type = type;
+                    switch(type) {
+                        case 'string':
+                            this._getStringWidget().placeAt(this.typeDetails);
+                            break;
+                        case 'text':
+                            break;
+                        case 'multipleChoice':
+                            break;
+                    }
+                }
+            },
+            _getStringWidget: function() {
+                if ( !this._stringWidget ) {
+                    this._stringWidget = new TextBox({
+                        name: 'answers',
+                        disabled: this.mode == 'view'
+                    });
+                }
+                return this._stringWidget;
+            },
+            _getValueAttr: function() {
+                return this.ourForm.get('value');
+            },
+            _setValueAttr: function(value) {
+                return this.ourForm.set('value',value);
+            }
+        });
+    });
Index: /Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js
===================================================================
--- /Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js	(revision 281)
+++ /Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js	(revision 281)
@@ -0,0 +1,10 @@
+require(['dojo/_base/declare','dojo/_base/query','dijit/registry','dojox/widget/TitleGroup'],function(declare,query,registry,TitleGroup){
+    declare('rft.ui.TitleGroup',[TitleGroup],{
+        getChildren: function() {
+            return query("> .dijitTitlePane", this.domNode)
+            .map(function(node){
+                return registry.byNode(node);
+            });
+        }
+    });
+});
Index: v/branches/rest-dojo-ui/log.txt
===================================================================
--- /Dev/branches/rest-dojo-ui/log.txt	(revision 280)
+++ 	(revision )
@@ -1,7 +1,0 @@
-* [Client] Moved pages in subtree of rft/, allowing controllers next to them.
-* [Client] Created questions page, gives overview and allows adding.
-* [Client] Page controllers inherit from _Page, because the previous mechanism wasn't working.
-* [Client] Added new user registration.
-* [Server] Changed user passwords to passwordHash/passwordSalt combination.
-* [Server] Added simple object marshalling and unmarshalling to preserve types.
-* [Server] Added ResearchToolObjectInterface with static create() method. Implemented for all model classes.
