Index: Dev/branches/rest-dojo-ui/client/config/docs.json
===================================================================
--- Dev/branches/rest-dojo-ui/client/config/docs.json	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/config/docs.json	(revision 406)
@@ -19,46 +19,9 @@
         }
     },
-    "rft/q1": {
-        "__configAction": "update",
-        "_id": "q1",
-        "title": "How long have you worked here?",
-        "categories": [
-            "Professional background"
-        ],
-        "topic": "Work experience",
-        "type": "Question"
-    },
-    "rft/q2": {
-        "__configAction": "update",
-        "_id": "q2",
-        "title": "How many years have you been employed here?",
-        "categories": [
-            "Respondent personals",
-            "Professional background"
-        ],
-        "topic": "Work experience",
-        "type": "Question"
-    },
-    "rft/q3": {
-        "__configAction": "update",
-        "_id": "q3",
-        "title": "Have you worked here longer than 10 years?",
-        "categories": [
-            "Respondent personals"
-        ],
-        "topic": "Work experience",
-        "type": "Question"
-    },
-    "rft/q4": {
-        "__configAction": "update",
-        "_id": "q4",
-        "title": "Rate your experience at your current employer from 1 to 10.",
-        "type": "Question"
-    },
     "rft/_design/default": {
         "__configAction": "replace",
         "_id": "_design/default",
         "language": "javascript",
-        "validate_doc_update": "function(newDoc, oldDoc, userCtx, secObj) { if (oldDoc && oldDoc.published) { throw({forbidden: 'Published documents cannot be modified.'}); } }",
+        "validate_doc_update": "function(newDoc, oldDoc, userCtx, secObj) { if(oldDoc&&oldDoc.published){throw({forbidden:'Published documents cannot be modified.'});} if (!newDoc.type){throw({forbidden:'Documents must have a type field.'});} }",
         "views": {
             "by_type": {
Index: Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 406)
@@ -2,7 +2,7 @@
     'dojo/_base/declare',
     'dijit/form/FilteringSelect'
-    ], function(declare, FilteringSelect) {
-	return declare("rft.elastic.ElasticSearchFilteringSelect", FilteringSelect, {
-	     // custom min input character count to trigger search
+], function(declare, FilteringSelect) {
+    return declare("rft.elastic.ElasticSearchFilteringSelect", FilteringSelect, {
+         // custom min input character count to trigger search
          minKeyCount: 3,
 
@@ -15,4 +15,4 @@
              this.inherited(arguments);
          }
-	});
+    });
 })
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html	(revision 406)
@@ -10,4 +10,9 @@
         
         <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" data-rft-attach-point="questionsPane">
+            <form data-dojo-type="dijit.form.Form" data-rft-attach-point="questionsForm"
+                  data-rft-attach-event="onSubmit:_onSubmit"
+                  style="overflow: auto">
+                <div data-rft-attach-point="questionsAnchor"></div>
+            </form>
         </div>
         
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 406)
@@ -23,9 +23,10 @@
                         store.query(null,{keys:this.survey.questions,include_docs:true})
                         .forEach(function(question){
-                            array.forEach(question.content,function(item){
-                                var w = f.createViewWidget(item);
+                            array.forEach(question.content || [],function(item){
+                                var w = f.createViewWidget(item,{
+                                    name: question.code+'.'+item.code
+                                });
                                 if ( w !== null ) {
-                                    w.placeAt(this.questionsPane.containerNode,'last');
-                                    w.startup();
+                                    w.placeAt(this.questionsAnchor,'before');
                                 }
                             },this);
@@ -37,4 +38,6 @@
             },
             _onSubmit: function(evt) {
+                var value = this.questionsForm.get('value');
+                this.questionsPane.set('content','<pre>'+JSON.stringify(value)+'</pre>');
                 event.stop(evt);
                 return false;
Index: Dev/branches/rest-dojo-ui/client/rft/store.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 406)
@@ -1,249 +1,256 @@
-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){
+define([
+    'dojo/_base/array',
+    'dojo/_base/declare',
+    'dojo/_base/Deferred',
+    'dojo/_base/json',
+    'dojo/_base/lang',
+    'dojo/_base/xhr',
+    'dojo/store/util/QueryResults'
+],function(array,declare,Deferred,json,lang,xhr,QueryResults){
     
-        var CouchStore = declare(null, {
-            /** dojo.Store implementation for CouchDB
-             *
-             * See for details on the REST API, the wiki
-             * at http://wiki.apache.org/couchdb/HTTP_Document_API.
-             */
-	        target: "",
-	        accepts: "application/json", 
-            idProperty: "_id",
-            revProperty: "_rev",
-            _responseIdProperty: "id",
-            _responseRevProperty: "rev",
-	        constructor: function(options){
-		        declare.safeMixin(this, options);
-            },
-	        getIdentity: function(object){
-		        return object[this.idProperty];
-            },
-	        getRevision: function(object){
-		        return object[this.revProperty];
-            },
-	        get: function(id){
-                var dfd = new Deferred();
-		        xhr("GET", {
-			        url: this.target + id,
-			        handleAs: "json",
-			        headers: {
-		                Accept: this.accepts
+    var CouchStore = declare(null, {
+        /** dojo.Store implementation for CouchDB
+         *
+         * See for details on the REST API, the wiki
+         * at http://wiki.apache.org/couchdb/HTTP_Document_API.
+         */
+        target: "",
+        accepts: "application/json", 
+        idProperty: "_id",
+        revProperty: "_rev",
+        _responseIdProperty: "id",
+        _responseRevProperty: "rev",
+        constructor: function(options){
+            declare.safeMixin(this, options);
+        },
+        getIdentity: function(object){
+            return object[this.idProperty];
+        },
+        getRevision: function(object){
+            return object[this.revProperty];
+        },
+        get: function(id){
+            var dfd = new Deferred();
+            xhr("GET", {
+                url: this.target + id,
+                handleAs: "json",
+                headers: {
+                    Accept: this.accepts
+                }
+            }).then(function(result){
+                if ( result.error ) {
+                    dfd.reject(result.reason);
+                } else {
+                    dfd.resolve(result);
+                }
+            }, function(err){
+                dfd.reject(err);
+            });
+            return dfd.promise;
+        },
+        put: function(object, options){
+             // summary:
+             //     put an object in CouchDB
+             // object: Object
+             //     The object to put
+             // options: Object
+             //     Options object as
+             //         id: String
+             //
+            options = options || {};
+
+            var dfd = new Deferred();
+            var id = options.id ? options.id : this.getIdentity(object);
+            var hasId = typeof id != "undefined";
+            xhr(hasId ? "PUT" : "POST", {
+                url: hasId ? this.target + id : this.target,
+                postData: json.toJson(object),
+                handleAs: "json",
+                headers:{
+                    "Content-Type": "application/json",
+                    Accept: this.accepts
+                }
+            }).then(lang.hitch(this,function(result){
+                if ( result.error ) {
+                    dfd.reject(result.reason);
+                } else {
+                    object[this.idProperty] = result[this._responseIdProperty];
+                    object[this.revProperty] = result[this._responseRevProperty];
+                    dfd.resolve(object);
+                }
+            }), function(err){
+                dfd.reject(err);
+            });
+            return dfd.promise;
+        },
+        add: function(object, options){
+            return this.put(object,options);
+        },
+        remove: function(id,rev){
+            var dfd = new Deferred();
+            xhr("DELETE",{
+                url: this.target + id,
+                headers: {
+                    'If-Match': rev
+                }
+            }).then(function(result){
+                if ( result.error ) {
+                    dfd.reject(result.reason);
+                } else {
+                    dfd.resolve();
+                }
+            },function(err){
+                dfd.reject(err);
+            });
+            return dfd.promise;
+        },
+        query: function(query, options){
+            // summary:
+            //    query a couchdb view
+            // query: String
+            //    name of a couchdb view you want to query, relative to the current database
+            // options: Object
+            //     options object as
+            //        start: Number
+            //            Start results at this item
+            //        count: Number
+            //            Number of items to return
+            //        sort: [{attribute:'key',descending:true|false}]
+            //            CouchDB only support sorting by key, so only 'key'
+            //            is allowed as attribute value. Multiple sort items
+            //            are ignored.
+            //        key: String|Array|Object
+            //            Return only values with this key.
+            //            Excludes start/endkey usage.
+            //        startkey: String|Array|Object
+            //            Return values starting from this key.
+            //        endkey: String|Array|Object
+            //            Return values with key lower than this key.
+            //        include_docs: true|false
+            //            Return the full documents instead of the view
+            //            values.
+            //        reduce: true|false
+            //            Execute reduce on the view or not. Default depends
+            //            on if a reduce function is defined on the view.
+            //        group: true|false
+            //            Should values be grouped per key or not? Default
+            //            is false.
+            //        group_level: Number
+            //            When group = true and the key is an array,
+            //            determines which elements starting from the first
+            //            are used for grouping. Default is 0.
+            //        get_keys: true|false
+            //            Instead of returning the values or documents,
+            //            return the array of keys as the result.
+            //            This does not affect the forPairs function.
+            options = options || {};
+
+            var dfd = new Deferred();
+            var queryOpts = {};
+            if ( !query ) {
+                query = '_all_docs';
+            }
+
+            if (!lang.isString(query)) {
+                console.warn("Query must be a view name");
+            }
+
+            // Standard options
+            if (options.start >= 0) {
+                queryOpts.skip = options.start;
+            }
+            if (options.count >= 0) {
+                queryOpts.limit = options.count;
+            }
+            if (options.sort) {
+                if (options.sort[0]) {
+                    if (options.sort[0].attribute && options.sort[0].attribute !== "key") {
+                        console.warn("Can only sort on key");
                     }
-		        }).then(function(result){
-                    if ( result.error ) {
-                        dfd.reject(result.reason);
+                    if (options.sort[0].descending) {
+                        queryOpts.descending = true;
+                    }
+                }
+                if (options.sort.length > 1) {
+                    console.warn("multiple sort fields not supported");
+                }
+            }
+
+            // Custom options
+            if (options.key !== undefined) {
+                queryOpts.key = options.key;
+            } else if (options.keys !== undefined) {
+                queryOpts.keys = options.keys;
+            } else if (options.startkey !== undefined || options.endkey !== undefined) {
+                queryOpts.startkey = options.startkey;
+                queryOpts.endkey = options.endkey;
+            }
+            if (options.include_docs !== undefined) {
+                queryOpts.include_docs = options.include_docs;
+            }
+            if (options.reduce !== undefined) {
+                queryOpts.reduce = options.reduce;
+            }
+            if (options.group !== undefined) {
+                queryOpts.group = options.group;
+                if (options.group_level !== undefined) {
+                    queryOpts.group_level = options.group_level;
+                }
+            }
+
+            for (var qp in queryOpts) {
+                queryOpts[qp] = json.toJson(queryOpts[qp]);
+            }
+            query += '?' + xhr.objectToQuery(queryOpts);
+
+            xhr("GET", {
+                url: this.target + query,
+                handleAs: "json",
+                headers: {
+                    Accept: this.accepts
+                }
+            }).then(function(result){
+                if (result.error) {
+                    dfd.reject(result.reason);
+                } else  {
+                    var results;
+                    var values = array.map(result.rows,function(result){
+                        return options.include_docs === true ? result.doc : result.value;
+                    });
+                    var keys = array.map(result.rows,function(result){
+                        return result.key;
+                    });
+                    if (options.get_keys === true) {
+                        results = keys;
+                        results.values = values;
                     } else {
-                        dfd.resolve(result);
+                        results = values;
+                        results.keys = keys;
                     }
-                }, function(err){
-                    dfd.reject(err);
+                    dfd.resolve(results);
+                }
+            },function(err){
+                dfd.reject(err);
+            });
+            return CouchResults(dfd.promise);
+        }
+    });
+
+    function CouchResults(results) {
+        results = QueryResults(results);
+        results.forPairs = function(callback,thisObject) {
+            callback = lang.hitch(thisObject,callback);
+            return Deferred.when(results,function(results) {
+                var values = results.values || results;
+                var keys = results.keys || results;
+                return array.forEach(values, function(value,index) {
+                    callback(value,keys[index],index);
                 });
-                return dfd.promise;
-            },
-	        put: function(object, options){
-                 // summary:
-                 //     put an object in CouchDB
-                 // object: Object
-                 //     The object to put
-                 // options: Object
-                 //     Options object as
-                 //         id: String
-                 //
-		        options = options || {};
-
-                var dfd = new Deferred();
-		        var id = options.id ? options.id : this.getIdentity(object);
-		        var hasId = typeof id != "undefined";
-		        xhr(hasId ? "PUT" : "POST", {
-				    url: hasId ? this.target + id : this.target,
-				    postData: json.toJson(object),
-				    handleAs: "json",
-				    headers:{
-					    "Content-Type": "application/json",
-					    Accept: this.accepts
-				    }
-			    }).then(lang.hitch(this,function(result){
-                    if ( result.error ) {
-                        dfd.reject(result.reason);
-                    } else {
-                        object[this.idProperty] = result[this._responseIdProperty];
-                        object[this.revProperty] = result[this._responseRevProperty];
-                        dfd.resolve(object);
-                    }
-                }), function(err){
-                    dfd.reject(err);
-                });
-                return dfd.promise;
-            },
-	        add: function(object, options){
-                return this.put(object,options);
-            },
-	        remove: function(id,rev){
-                var dfd = new Deferred();
-		        xhr("DELETE",{
-			        url: this.target + id,
-				    headers: {
-                        'If-Match': rev
-                    }
-		        }).then(function(result){
-                    if ( result.error ) {
-                        dfd.reject(result.reason);
-                    } else {
-                        dfd.resolve();
-                    }
-                },function(err){
-                    dfd.reject(err);
-                });
-                return dfd.promise;
-            },
-            query: function(query, options){
-                // summary:
-                //    query a couchdb view
-                // query: String
-                //    name of a couchdb view you want to query, relative to the current database
-                // options: Object
-                //     options object as
-                //        start: Number
-                //            Start results at this item
-                //        count: Number
-                //            Number of items to return
-                //        sort: [{attribute:'key',descending:true|false}]
-                //            CouchDB only support sorting by key, so only 'key'
-                //            is allowed as attribute value. Multiple sort items
-                //            are ignored.
-                //        key: String|Array|Object
-                //            Return only values with this key.
-                //            Excludes start/endkey usage.
-                //        startkey: String|Array|Object
-                //            Return values starting from this key.
-                //        endkey: String|Array|Object
-                //            Return values with key lower than this key.
-                //        include_docs: true|false
-                //            Return the full documents instead of the view
-                //            values.
-                //        reduce: true|false
-                //            Execute reduce on the view or not. Default depends
-                //            on if a reduce function is defined on the view.
-                //        group: true|false
-                //            Should values be grouped per key or not? Default
-                //            is false.
-                //        group_level: Number
-                //            When group = true and the key is an array,
-                //            determines which elements starting from the first
-                //            are used for grouping. Default is 0.
-                //        get_keys: true|false
-                //            Instead of returning the values or documents,
-                //            return the array of keys as the result.
-                //            This does not affect the forPairs function.
-		        options = options || {};
-
-                var dfd = new Deferred();
-                var queryOpts = {};
-                if ( !query ) {
-                    query = '_all_docs';
-                }
-
-                if (!lang.isString(query)) {
-                    console.warn("Query must be a view name");
-                }
-
-                // Standard options
-                if (options.start >= 0) {
-                    queryOpts.skip = options.start;
-                }
-                if (options.count >= 0) {
-                    queryOpts.limit = options.count;
-                }
-                if (options.sort) {
-                    if (options.sort[0]) {
-                        if (options.sort[0].attribute && options.sort[0].attribute !== "key") {
-                            console.warn("Can only sort on key");
-                        }
-                        if (options.sort[0].descending) {
-                            queryOpts.descending = true;
-                        }
-                    }
-                    if (options.sort.length > 1) {
-                        console.warn("multiple sort fields not supported");
-                    }
-                }
-
-                // Custom options
-                if (options.key !== undefined) {
-                    queryOpts.key = options.key;
-                } else if (options.keys !== undefined) {
-                    queryOpts.keys = options.keys;
-                } else if (options.startkey !== undefined || options.endkey !== undefined) {
-                    queryOpts.startkey = options.startkey;
-                    queryOpts.endkey = options.endkey;
-                }
-                if (options.include_docs !== undefined) {
-                    queryOpts.include_docs = options.include_docs;
-                }
-                if (options.reduce !== undefined) {
-                    queryOpts.reduce = options.reduce;
-                }
-                if (options.group !== undefined) {
-                    queryOpts.group = options.group;
-                    if (options.group_level !== undefined) {
-                        queryOpts.group_level = options.group_level;
-                    }
-                }
-
-                for (var qp in queryOpts) {
-                    queryOpts[qp] = json.toJson(queryOpts[qp]);
-                }
-			    query += '?' + xhr.objectToQuery(queryOpts);
-
-		        xhr("GET", {
-			        url: this.target + query,
-			        handleAs: "json",
-			        headers: {
-                        Accept: this.accepts
-                    }
-		        }).then(function(result){
-                    if (result.error) {
-                        dfd.reject(result.reason);
-                    } else  {
-                        var results;
-                        var values = array.map(result.rows,function(result){
-                            return options.include_docs === true ? result.doc : result.value;
-                        });
-                        var keys = array.map(result.rows,function(result){
-                            return result.key;
-                        });
-                        if (options.get_keys === true) {
-                            results = keys;
-                            results.values = values;
-                        } else {
-                            results = values;
-                            results.keys = keys;
-                        }
-                        dfd.resolve(results);
-                    }
-                },function(err){
-                    dfd.reject(err);
-                });
-		        return CouchResults(dfd.promise);
-            }
-        });
-
-        function CouchResults(results) {
-            results = QueryResults(results);
-            results.forPairs = function(callback,thisObject) {
-                callback = lang.hitch(thisObject,callback);
-                return Deferred.when(results,function(results) {
-                    var values = results.values || results;
-                    var keys = results.keys || results;
-                    return array.forEach(values, function(value,index) {
-                        callback(value,keys[index],index);
-                    });
-                });
-            }
-            return results;
-        }
-
-        return new CouchStore({target: 'data/rft/'});
-
-    });
+            });
+        };
+        return results;
+    }
+
+    return new CouchStore({target: 'data/rft/'});
+
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js	(revision 406)
@@ -6,94 +6,94 @@
     'dojo/topic',
     'dijit/_WidgetBase'
-    ], function(declare, baseArray, Button, domClass, topic, _WidgetBase){
-        return declare('rft.ui.Breadcrumbs', [_WidgetBase], {
-            _crumbs: [],
-            
-            _last: function(){
-                return this._crumbs[this._crumbs.length-1];
-            },
-            _getIndexOf: function(label) {
-                dojo.forEach(this._crumbs, function(crumb, index){
-                    if (crumb.label == label) {
-                        return index;
-                    }
-                }, this);
-                return -1;
-            },
-            
-            addCrumb: function(label, path) {
-                this._crumbs.push({
-                    label: label, 
-                    path:path
-                });
-            },
-            _removeAfter: function(index) {
-                var removals = this._crumbs.slice(index+1);
-                this._crumbs = this._crumbs.slice(0, index+1);
-                dojo.forEach(removals, function(removal){
-                    removal.widget.destroyRecursive(false); // boolean "keepDOMnode"
-                }, this);
-                this._highlightLast();
-            },
-            
-            _highlightLast: function() {
-                domClass.add(this._last().widget, "breadcrumbCurrent");
-            },
-            _unhighlightLast: function() {
-                domClass.remove(this._last(), "breadcrumbCurrent");
-            },
-            
-            _changeTo: function(label, path) {
-                // TODO: Differentiate between navigating backwards and sideways/forward!
-                var index = baseArray.indexOf({label:label , path:path});
-                //var index = this._getIndexOf(label);  // Use this if passing path as an argument is not possible!
-                if (index >= 0) this._removeAfter(index);
-                this._addCrumb(label, path);
-                this._createBreadcrumbs();
-            },
-            
-            _createBreadcrumb: function(label, path) {
-                return new Button({
-                    baseClass: "breadcrumb",
-                    label: label,
-                    showlabel: true,
-                    iconClass: "dijitNoIcon",
-                    onClick: lang.hitch(this, function(){
-                        rft.api.loadPage(path);  // TODO: fix this call!
-                    })
-                });
-            },
-            _createBreadcrumbs: function() {
-                dojo.forEach(this._crumbs, function(crumb, index){
-                    if (!crumb.widget) {
-                        crumb.widget = this._createBreadcrumb(crumb.label, crumb.path);
-                    }
-                }, this);
-                this._highlightLast();
-            },
-            startup: function() {
-                if ( this._started ){ return; }
-				this.inherited(arguments);
-                // TODO: start page crumb creation?
-                this._createBreadCrumbs();
-                this._setupEvents();
-                this.inherited(arguments);
-            },
-            _setupEvents: function() {
-            // TODO: Bind changeTo() listener to an "onLoadPage" event exposed by rft.api!
-            topic.subscribe("rft/content/goTo", this._changeTo(label, path));
-            }
-        });
+], function(declare, baseArray, Button, domClass, topic, _WidgetBase){
+    return declare('rft.ui.Breadcrumbs', [_WidgetBase], {
+        _crumbs: [],
+        
+        _last: function(){
+            return this._crumbs[this._crumbs.length-1];
+        },
+        _getIndexOf: function(label) {
+            dojo.forEach(this._crumbs, function(crumb, index){
+                if (crumb.label == label) {
+                    return index;
+                }
+            }, this);
+            return -1;
+        },
+        
+        addCrumb: function(label, path) {
+            this._crumbs.push({
+                label: label, 
+                path:path
+            });
+        },
+        _removeAfter: function(index) {
+            var removals = this._crumbs.slice(index+1);
+            this._crumbs = this._crumbs.slice(0, index+1);
+            dojo.forEach(removals, function(removal){
+                removal.widget.destroyRecursive(false); // boolean "keepDOMnode"
+            }, this);
+            this._highlightLast();
+        },
+        
+        _highlightLast: function() {
+            domClass.add(this._last().widget, "breadcrumbCurrent");
+        },
+        _unhighlightLast: function() {
+            domClass.remove(this._last(), "breadcrumbCurrent");
+        },
+        
+        _changeTo: function(label, path) {
+            // TODO: Differentiate between navigating backwards and sideways/forward!
+            var index = baseArray.indexOf({label:label , path:path});
+            //var index = this._getIndexOf(label);  // Use this if passing path as an argument is not possible!
+            if (index >= 0) this._removeAfter(index);
+            this._addCrumb(label, path);
+            this._createBreadcrumbs();
+        },
+        
+        _createBreadcrumb: function(label, path) {
+            return new Button({
+                baseClass: "breadcrumb",
+                label: label,
+                showlabel: true,
+                iconClass: "dijitNoIcon",
+                onClick: lang.hitch(this, function(){
+                    rft.api.loadPage(path);  // TODO: fix this call!
+                })
+            });
+        },
+        _createBreadcrumbs: function() {
+            dojo.forEach(this._crumbs, function(crumb, index){
+                if (!crumb.widget) {
+                    crumb.widget = this._createBreadcrumb(crumb.label, crumb.path);
+                }
+            }, this);
+            this._highlightLast();
+        },
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            // TODO: start page crumb creation?
+            this._createBreadCrumbs();
+            this._setupEvents();
+            this.inherited(arguments);
+        },
+        _setupEvents: function() {
+        // TODO: Bind changeTo() listener to an "onLoadPage" event exposed by rft.api!
+        topic.subscribe("rft/content/goTo", this._changeTo(label, path));
+        }
     });
-    
-    /*  Breadcrumbs system, which automatically generates styled buttons in the topBar.
-     *  Updates are triggered through a "changePage" subscription to "rft/connect/goTo" (method that loads pages in rft.connect.js)
-     *
-     * Todo: Startup() does not handle initial creation well. No initial breadcrumb is created on page load. What happens when I refresh the page, do all previous crumbs disappear?
-     * Todo: Pages should have a label/name besides the path, for display in the breadcrumbs bar. Perhaps the page main title? (Generate this header dynamically?)
-     * Todo: Put connect.publish("rft/content/goTo", args); call in rft/content, to trigger breadcrumbs updates
-     *      This method uses path and 'args'(?) instead of label and path, change terminology accordingly?
-     * Todo: breadcrumbs do not have context yet, unless we can somehow create that context from the path. Split path at "/" char, lookup label/title for each step?
-     *      (See before!)
-     * 
-     */
+});
+
+/*  Breadcrumbs system, which automatically generates styled buttons in the topBar.
+ *  Updates are triggered through a "changePage" subscription to "rft/connect/goTo" (method that loads pages in rft.connect.js)
+ *
+ * Todo: Startup() does not handle initial creation well. No initial breadcrumb is created on page load. What happens when I refresh the page, do all previous crumbs disappear?
+ * Todo: Pages should have a label/name besides the path, for display in the breadcrumbs bar. Perhaps the page main title? (Generate this header dynamically?)
+ * Todo: Put connect.publish("rft/content/goTo", args); call in rft/content, to trigger breadcrumbs updates
+ *      This method uses path and 'args'(?) instead of label and path, change terminology accordingly?
+ * Todo: breadcrumbs do not have context yet, unless we can somehow create that context from the path. Split path at "/" char, lookup label/title for each step?
+ *      (See before!)
+ * 
+ */
Index: Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 406)
@@ -1,87 +1,86 @@
 define(['dojo/_base/declare',
-	'dojo/_base/lang',
-	'dojo/on',
-	'dojo/dom',
-	'dojo/_base/event',
-	'dojo/dom-class',
-	'dijit/form/Button',
-	'dijit/_WidgetBase',
-	'dijit/_TemplatedMixin',
-	'dijit/_WidgetsInTemplateMixin',
-	'dojo/text!./templates/LineWithActionsWidget.html'
-	],
-	function(declare,lang,on,dom,event,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
-		return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
-			templateString: templateString,
-			baseClass: 'rftLineWithButtons',
-			title: '',
-			selectable: false,
-			userObject: null,
+    'dojo/_base/lang',
+    'dojo/on',
+    'dojo/dom',
+    'dojo/_base/event',
+    'dojo/dom-class',
+    'dijit/form/Button',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/LineWithActionsWidget.html'
+],function(declare,lang,on,dom,event,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
+    return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        templateString: templateString,
+        baseClass: 'rftLineWithButtons',
+        title: '',
+        selectable: false,
+        userObject: null,
 
-			actions: null,
-			postCreate: function() {
-				dom.setSelectable(this.domNode, false); // Text selection, has nothing to do with object selection!
-				on(this.domNode,'click',lang.hitch(this,'_onClick'));
-			},
-			startup: function() {
-                if ( this._started ){ return; }
-				this.inherited(arguments);
-				this._setupActions();
-				domClass.add(this.domNode, "inheritBgColor bg");
-				this.refresh();
-			},
-			_setupActions: function() {
-                if ( this.actions === null ) {
-                    return;
+        actions: null,
+        postCreate: function() {
+            dom.setSelectable(this.domNode, false); // Text selection, has nothing to do with object selection!
+            on(this.domNode,'click',lang.hitch(this,'_onClick'));
+        },
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this._setupActions();
+            domClass.add(this.domNode, "inheritBgColor bg");
+            this.refresh();
+        },
+        _setupActions: function() {
+            if ( this.actions === null ) {
+                return;
+            }
+            for (var action in this.actions) {
+                var properties;
+                if (this.actions[action].properties.blockButton === true) {
+                    properties = lang.mixin({
+                        baseClass: 'rftBlockButton',
+                        "class": "inheritBgColor light",
+                        label: "Default",
+                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
+                        title: this.actions[action].properties.tooltip,
+                        onClick: lang.hitch(this, function(action, e){
+                            action.callback && action.callback(e);
+                            event.stop(e);
+                            return false;
+                        }, this.actions[action])
+                    }, this.actions[action].properties);
+                    new Button(properties).placeAt(this.buttonsNode);
+                } else {
+                    properties = lang.mixin({
+                        baseClass: 'rftInlineButton',
+                        label: "Default",
+                        showLabel: false,
+                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
+                        title: this.actions[action].properties.tooltip,
+                        onClick: lang.hitch(this, function(action, e){
+                            action.callback && action.callback(e);
+                            event.stop(e);
+                            return false;
+                        }, this.actions[action])
+                    }, this.actions[action].properties);
+                    new Button(properties).placeAt(this.buttonsNode);
                 }
-				for (var action in this.actions) {
-					var properties;
-					if (this.actions[action].properties.blockButton == true) {
-						properties = lang.mixin({
-							baseClass: 'rftBlockButton',
-                            "class": "inheritBgColor light",
-							label: "Default",
-							iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
-							title: this.actions[action].properties.tooltip,
-                            onClick: lang.hitch(this, function(action, e){
-                                action.callback && action.callback(e);
-                                event.stop(e);
-                                return false;
-                            }, this.actions[action])
-						}, this.actions[action].properties);
-                        new Button(properties).placeAt(this.buttonsNode);
-                    } else {
-                        properties = lang.mixin({
-                            baseClass: 'rftInlineButton',
-                            label: "Default",
-                            showLabel: false,
-                            iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
-                            title: this.actions[action].properties.tooltip,
-                            onClick: lang.hitch(this, function(action, e){
-                                action.callback && action.callback(e);
-                                event.stop(e);
-                                return false;
-                            }, this.actions[action])
-                        }, this.actions[action].properties);
-                        new Button(properties).placeAt(this.buttonsNode);
-                    }
-                }
-            },
-            refresh: function() {
-                this.titleNode.innerHTML = this.title;
-            },
-            _onClick: function(e){
-                var preventDefault = this.onClick(e) === false;
-                if (preventDefault) {
-                    event.stop(e);
-                }
-                return !preventDefault;
-            },
-            onClick: function(e) {
-            },
-            _setTitleAttr: function(value){
-                this.title = value;
-                this.refresh();
             }
-        });
+        },
+        refresh: function() {
+            this.titleNode.innerHTML = this.title;
+        },
+        _onClick: function(e){
+            var preventDefault = this.onClick(e) === false;
+            if (preventDefault) {
+                event.stop(e);
+            }
+            return !preventDefault;
+        },
+        onClick: function(e) {
+        },
+        _setTitleAttr: function(value){
+            this.title = value;
+            this.refresh();
+        }
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js	(revision 406)
@@ -7,69 +7,69 @@
     'rft/ui/LineWithActionsWidget',
     'dojo/text!./templates/ObjectBox.html',
-    ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
-        return declare('rft.ui.ObjectBox', [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
-            baseClass: "rftObjectBox",
-            templateString: template,
-            value: null,
-            actions: null,
-            startup: function() {
-                if ( this._started ){ return; }
-				this.inherited(arguments);
-                this.line1 = new LineWithActionsWidget({
-                    actions: {
-                        "inspectIcon": {
-                            callback: lang.hitch(this, this._showInfoBox),
-                            properties: {
-                                blockButton: false,
-                                icon: "Inspect"
-                            }
+], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
+    return declare('rft.ui.ObjectBox', [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
+        baseClass: "rftObjectBox",
+        templateString: template,
+        value: null,
+        actions: null,
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this.line1 = new LineWithActionsWidget({
+                actions: {
+                    "inspectIcon": {
+                        callback: lang.hitch(this, this._showInfoBox),
+                        properties: {
+                            blockButton: false,
+                            icon: "Inspect"
                         }
                     }
-                }).placeAt(this.line1Node);
-                this.line2 = new LineWithActionsWidget({
-                }).placeAt(this.line1Node);
-                var line3Actions = this._createLine3Actions();
-                this.line3 = new LineWithActionsWidget({
-                    actions: line3Actions
-                }).placeAt(this.line1Node);
-                this.line1.startup();
-                this.line2.startup();
-                this.line3.startup();
-                this.inherited(arguments);
-            },
-            _createLine3Actions: function() {
-                var line3Actions = {};
-                for (var action in this.actions) {
-                    line3Actions[action] = {
-                        callback: lang.hitch(this, function(callback){
-                            this.value && callback(this.value);
-                        }, this.actions[action]),
-                        properties: {
-                            blockButton: true,
-                            label: action,
-                            icon: action.charAt(0).toUpperCase()+action.slice(1)
-                        }
-                    };
                 }
-                return line3Actions;
-            },
-            _showInfoBox: function() {
-                alert(this.value.description);
-            },
-            _setValueAttr: function(value) {
-                this.value = value;
-                this._refresh();
-            },
-            _getValueAttr: function(value) {
-                this.value = value;
-            },
-            _refresh: function() {
-                if ( this.value !== null ) {
-                    this.iconNode.className = "rftIcon typeIcon rftIcon"+(this.value.type || '');
-                    this.line1.set('title', this.value.title || '');
-                    this.line2.set('title', this.value.subTitle || '');
-                    this.line3.set('title', this.value.lowerTitle || '');
-                }
+            }).placeAt(this.line1Node);
+            this.line2 = new LineWithActionsWidget({
+            }).placeAt(this.line1Node);
+            var line3Actions = this._createLine3Actions();
+            this.line3 = new LineWithActionsWidget({
+                actions: line3Actions
+            }).placeAt(this.line1Node);
+            this.line1.startup();
+            this.line2.startup();
+            this.line3.startup();
+            this.inherited(arguments);
+        },
+        _createLine3Actions: function() {
+            var line3Actions = {};
+            for (var action in this.actions) {
+                line3Actions[action] = {
+                    callback: lang.hitch(this, function(callback){
+                        this.value && callback(this.value);
+                    }, this.actions[action]),
+                    properties: {
+                        blockButton: true,
+                        label: action,
+                        icon: action.charAt(0).toUpperCase()+action.slice(1)
+                    }
+                };
             }
-        });
+            return line3Actions;
+        },
+        _showInfoBox: function() {
+            alert(this.value.description);
+        },
+        _setValueAttr: function(value) {
+            this.value = value;
+            this._refresh();
+        },
+        _getValueAttr: function(value) {
+            this.value = value;
+        },
+        _refresh: function() {
+            if ( this.value !== null ) {
+                this.iconNode.className = "rftIcon typeIcon rftIcon"+(this.value.type || '');
+                this.line1.set('title', this.value.title || '');
+                this.line2.set('title', this.value.subTitle || '');
+                this.line3.set('title', this.value.lowerTitle || '');
+            }
+        }
+    });
 });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js	(revision 406)
@@ -13,166 +13,166 @@
     'dojo/text!./templates/Selector.html',
     'dojo/dom-class',
-    ],function(
-        declare,
-        baseArray,
-        registry,
-        lang,
-        event,
-        fx,
-        _WidgetBase,
-        _TemplatedMixin,
-        _WidgetsInTemplateMixin,
-        _Container,
-        LineWithActionsWidget,
-        templateString,
-        domClass
-        ){
-        return declare('rft.ui.Selector',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
-            templateString: templateString,
-            baseClass: 'rftSelector',
+],function(
+    declare,
+    baseArray,
+    registry,
+    lang,
+    event,
+    fx,
+    _WidgetBase,
+    _TemplatedMixin,
+    _WidgetsInTemplateMixin,
+    _Container,
+    LineWithActionsWidget,
+    templateString,
+    domClass
+    ){
+    return declare('rft.ui.Selector',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        templateString: templateString,
+        baseClass: 'rftSelector',
 
-            title: "",
-            selectedActions: null,
-            itemActions: null,
-            // main selector action: Object
-            //    title:
-            //    description:
-            //    icon:
+        title: "",
+        selectedActions: null,
+        itemActions: null,
+        // main selector action: Object
+        //    title:
+        //    description:
+        //    icon:
 
-            _folded: true,
-            _titleLine: null,
-            _selectorLine: null,
-            _selectedItem: null,
+        _folded: true,
+        _titleLine: null,
+        _selectorLine: null,
+        _selectedItem: null,
 
-            startup: function() {
-                if ( this._started ){ return; }
-				this.inherited(arguments);
-                domClass.add(this.selectedColorNode, "pending");
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            domClass.add(this.selectedColorNode, "pending");
 
-                this._createTitleLine();
-                this._createSelectorLine();
+            this._createTitleLine();
+            this._createSelectorLine();
 
+            fx.wipeOut({
+                node: this.optionsNode
+            }).play();
+        },
+        _createTitleLine: function() {
+            var actions = {};
+            var action = null;
+            if ( this.selectedActions !== null ) {
+                for (var actionName in this.selectedActions) {
+                    action = this.selectedActions[actionName];
+                    actions[actionName] = {
+                        callback: action.callback &&
+                                lang.hitch(this,this._onSelectedAction,
+                                        action.callback),
+                        properties: {
+                             blockButton: true,
+                             label: action.title || actionName,
+                             icon: action.icon,
+                             tooltip: action.description
+                         }
+
+                    };
+                }
+            }
+
+            this._titleLine = new LineWithActionsWidget({
+                title: this.title,
+                actions: actions
+            },this.titleNode);
+            this._titleLine.startup();
+        },
+        _createSelectorLine: function() {
+            this._selectorLine = new LineWithActionsWidget({
+                title: 'None',
+                actions: {
+                    "Toggle dropdown" : {
+                        callback: lang.hitch(this, this.onToggle),
+                        properties: {
+                            blockButton: true,
+                            showLabel: false,
+                            icon: "HalfArrowDown"
+                        }
+                    }
+                }
+            },this.selectedItemNode);
+            this._selectorLine.startup();
+            this._selectorLine.on('click',lang.hitch(this, this.onToggle));
+        },
+        _onSelect: function(item, widget) {
+            this._selectedItem = item;
+            this.onToggle();
+            this._selectorLine.set("title", item.title);
+            baseArray.forEach(this.optionsNode.childNodes, function(node){
+                var line = registry.byNode(node);
+                if (line) {
+                    if (line === widget) {
+                        domClass.add(line.domNode, "inheritBgColor light");
+                    } else {
+                        domClass.remove(line.domNode, "inheritBgColor light");
+                    }
+                }
+            }, this);
+            this.onSelect(item);
+        },
+        _onSelectedAction: function(callback) {
+            if (this._selectedItem && callback) {
+                callback(this._selectedItem);
+            }
+        },
+
+        onToggle: function(evt) {
+            if (this._folded) {
+                var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
+                if (downArrowIcon){
+                    domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
+                }
+                fx.wipeIn({
+                    node: this.optionsNode
+                }).play();
+                this._folded = false;
+            } else {
+                var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
+                if (upArrowIcon){
+                    domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
+                }
                 fx.wipeOut({
                     node: this.optionsNode
                 }).play();
-            },
-            _createTitleLine: function() {
-                var actions = {};
-                var action = null;
-                if ( this.selectedActions !== null ) {
-                    for (var actionName in this.selectedActions) {
-                        action = this.selectedActions[actionName];
-                        actions[actionName] = {
-                            callback: action.callback &&
-                                    lang.hitch(this,this._onSelectedAction,
-                                            action.callback),
-                            properties: {
-                                 blockButton: true,
-                                 label: action.title || actionName,
-                                 icon: action.icon,
-                                 tooltip: action.description
-                             }
+                this._folded = true;
+            }
+            evt && event.stop(evt);
+            return false;
+        },
 
-                        };
-                    }
-                }
-
-                this._titleLine = new LineWithActionsWidget({
-                    title: this.title,
-                    actions: actions
-                },this.titleNode);
-                this._titleLine.startup();
-            },
-            _createSelectorLine: function() {
-                this._selectorLine = new LineWithActionsWidget({
-                    title: 'None',
-                    actions: {
-                        "Toggle dropdown" : {
-                            callback: lang.hitch(this, this.onToggle),
-                            properties: {
-                                blockButton: true,
-                                showLabel: false,
-                                icon: "HalfArrowDown"
-                            }
-                        }
-                    }
-                },this.selectedItemNode);
-                this._selectorLine.startup();
-                this._selectorLine.on('click',lang.hitch(this, this.onToggle));
-            },
-            _onSelect: function(item, widget) {
-                this._selectedItem = item;
-                this.onToggle();
-                this._selectorLine.set("title", item.title);
-                baseArray.forEach(this.optionsNode.childNodes, function(node){
-                    var line = registry.byNode(node);
-                    if (line) {
-                        if (line === widget) {
-                            domClass.add(line.domNode, "inheritBgColor light");
-                        } else {
-                            domClass.remove(line.domNode, "inheritBgColor light");
-                        }
-                    }
-                }, this);
-                this.onSelect(item);
-            },
-            _onSelectedAction: function(callback) {
-                if (this._selectedItem && callback) {
-                    callback(this._selectedItem);
-                }
-            },
-
-            onToggle: function(evt) {
-                if (this._folded) {
-                    var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
-                    if (downArrowIcon){
-                        domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
-                    }
-                    fx.wipeIn({
-                        node: this.optionsNode
-                    }).play();
-                    this._folded = false;
-                } else {
-                    var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
-                    if (upArrowIcon){
-                        domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
-                    }
-                    fx.wipeOut({
-                        node: this.optionsNode
-                    }).play();
-                    this._folded = true;
-                }
-                evt && event.stop(evt);
-                return false;
-            },
-
-            addItem: function(item) {
-                var actions = {};
-                var action;
-                if (this.itemActions) {
-                    for (var actionName in this.itemActions) {
-                        action = this.itemActions[actionName];
-                        actions[actionName] = {
-                            callback: function(){
-                                action.callback && action.callback(item);
-                            },
-                            properties: {
-                                blockButton: false,
-                                showLabel: false,
-                                icon: action.icon + " black",
-                                tooltip: action.description
-                            }
+        addItem: function(item) {
+            var actions = {};
+            var action;
+            if (this.itemActions) {
+                for (var actionName in this.itemActions) {
+                    action = this.itemActions[actionName];
+                    actions[actionName] = {
+                        callback: function(){
+                            action.callback && action.callback(item);
+                        },
+                        properties: {
+                            blockButton: false,
+                            showLabel: false,
+                            icon: action.icon + " black",
+                            tooltip: action.description
                         }
                     }
                 }
-                var w = new LineWithActionsWidget({
-                    title: item.title,
-                    actions: actions
-                }).placeAt(this.optionsNode);
-                w.startup();
-                w.on("click", lang.hitch(this, this._onSelect, item, w));
-            },
+            }
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                actions: actions
+            }).placeAt(this.optionsNode);
+            w.startup();
+            w.on("click", lang.hitch(this, this._onSelect, item, w));
+        },
 
-            onSelect: function(item) {}
-        });
+        onSelect: function(item) {}
+    });
 });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 406)
@@ -18,5 +18,4 @@
 ],function(array, declare, lang, domConstruct, _TemplatedMixin, _WidgetBase, _Container, Button, CheckBox, NumberSpinner, RadioButton, Textarea, TextBox, TableContainer, _EditableListMixin, OrderedList) {
     var factory = declare('rft.ui.content.ContentWidgetFactory', [], {
-        /* No default type, all should be valid */
         createViewWidget: function(/*Object*/options) {
             // options: Object
@@ -151,5 +150,7 @@
         _textBox: null,
         postCreate: function() {
-            this._textBox = new TextBox();
+            this._textBox = new TextBox({
+                name: this.options.code || ''
+            });
             this.addChild(this._textBox);
             this._textBox.startup();
@@ -197,5 +198,7 @@
         _textArea: null,
         postCreate: function() {
-            this._textArea = new Textarea();
+            this._textArea = new Textarea({
+                name: this.options.code
+            });
             this._textArea.set('maxLength', this.options.maxLength || 1000);
             this._textArea.set('value', this.options.defaultValue || "");
@@ -256,4 +259,5 @@
         postCreate: function() {
             this._numberInput = new NumberSpinner({
+                name: this.options.code || '',
                 constraints: {
                     min: this.options.min,
@@ -333,6 +337,7 @@
 
             var ctor = this.options.multiple === true ? CheckBox : RadioButton;
-            array.forEach(this.options.items ,function(item){
+            array.forEach(this.options.items || [],function(item){
                 table.addChild(new ctor({
+                        name: this.options.code || '',
                         title: item
                 }));
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js	(revision 406)
@@ -1,42 +1,42 @@
 define([
     'dojo/_base/declare',
-   	'dojo/_base/lang',
+       'dojo/_base/lang',
     'dojo/dom-construct',
     '../LineWithActionsWidget',
     './OrderedList'
-	],function(
-        declare,
-        lang,
-        domConstruct,
-        LineWithActionsWidget,
-        OrderedList
-		) {
-        return declare('rft.ui.lists.AccountListView',[OrderedList],{
-            baseClass: 'rftAccountListView',
-            type: 'account',
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+) {
+    return declare('rft.ui.lists.AccountListView',[OrderedList],{
+        baseClass: 'rftAccountListView',
+        type: 'account',
 
-            _createAvatarNode: function(item){
-                return domConstruct.create("div",{
-                    'class': 'dragAvatar',
-                    innerHTML: item.title
-                });
-            },
-            _createListNode: function(item) {
-        		var w = new LineWithActionsWidget({
-        			title: item.title,
-        			'class': "green",
-        			actions: {
-        				"Remove" : {
-        					callback: lang.hitch(this, 'removeItem', item),
-        					properties: {
-        						blockButton: false,
-        						icon: "Delete"
-        					}
-        				}
-        			}
-        		});
-        		w.startup();
-        		return w.domNode;
-        	}
-        });
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "green",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
+                        }
+                    }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js	(revision 406)
@@ -5,38 +5,38 @@
     '../LineWithActionsWidget',
     './OrderedList'
-    ],function(
-        declare,
-        lang,
-        domConstruct,
-        LineWithActionsWidget,
-        OrderedList
-        ) {
-        return declare('rft.ui.lists.MultipleChoiceListView',[OrderedList],{
-            baseClass: 'rftMultipleChoiceListView',
-            type: 'multipleChoiceOption',
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+    ) {
+    return declare('rft.ui.lists.MultipleChoiceListView',[OrderedList],{
+        baseClass: 'rftMultipleChoiceListView',
+        type: 'multipleChoiceOption',
 
-            _createAvatarNode: function(item){
-                return domConstruct.create("div",{
-                    'class': 'dragAvatar',
-                    innerHTML: item.title
-                });
-            },
-            _createListNode: function(item) {
-                var w = new LineWithActionsWidget({
-                    title: item.title,
-                    'class': "orange",
-                    actions: {
-                        "Remove" : {
-        					callback: lang.hitch(this, 'removeItem', item),
-                            properties: {
-                                blockButton: false,
-                                icon: "Delete"
-                            }
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "orange",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
                         }
                     }
-                });
-                w.startup();
-                return w.domNode;
-            }
-        });
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js	(revision 405)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js	(revision 406)
@@ -5,47 +5,47 @@
     '../LineWithActionsWidget',
     './OrderedList'
-    ],function(
-        declare,
-        lang,
-        domConstruct,
-        LineWithActionsWidget,
-        OrderedList
-    ){
-        return declare('rft.ui.lists.QuestionListView',[OrderedList],{
-            baseClass: 'rftSurveyListView',
-            type: 'question',
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+){
+    return declare('rft.ui.lists.QuestionListView',[OrderedList],{
+        baseClass: 'rftSurveyListView',
+        type: 'question',
 
-            _createAvatarNode: function(item){
-                return domConstruct.create("div",{
-                    'class': 'dragAvatar',
-                    innerHTML: item.title
-                });
-            },
-            _createListNode: function(item) {
-                var w = new LineWithActionsWidget({
-                    title: item.title,
-                    'class': "inheritBgColor",
-                    actions: {
-                        "Remove" : {
-        					callback: lang.hitch(this, 'removeItem', item),
-                            properties: {
-                                blockButton: false,
-                                icon: "Delete",
-                                label: "Remove"
-                            }
-                        },
-                        "Info" : {
-                            callback: function(){ item.description && alert(item.description); },
-                            properties: {
-                                blockButton: false,
-                                icon: "Inspect",
-                                label: "Show info"
-                            }
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "inheritBgColor",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete",
+                            label: "Remove"
+                        }
+                    },
+                    "Info" : {
+                        callback: function(){ item.description && alert(item.description); },
+                        properties: {
+                            blockButton: false,
+                            icon: "Inspect",
+                            label: "Show info"
                         }
                     }
-                });
-                w.startup();
-                return w.domNode;
-            }
-        });
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
     });
+});
