Index: Dev/branches/rest-dojo-ui/client/pages/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/index.html	(revision 263)
+++ Dev/branches/rest-dojo-ui/client/pages/index.html	(revision 263)
@@ -0,0 +1,3 @@
+<div>
+    <h1>Index pagina</h1>
+</div>
Index: Dev/branches/rest-dojo-ui/client/pages/session.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/session.html	(revision 260)
+++ Dev/branches/rest-dojo-ui/client/pages/session.html	(revision 263)
@@ -1,5 +1,6 @@
-<div data-dojo-type="rft.ui.Page">
-    <script type="dojo/method" data-dojo-event="init">
+<div>
+    <script type="dojo/method" data-dojo-event="onVisit">
         var that = this;
+        debugger;
         require(['dojo/_base/json','dojo/dom','dojo/store/JsonRest','dojo/domReady!'],
             function(json,dom,JsonRest){
Index: Dev/branches/rest-dojo-ui/client/pages/sessions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/sessions.html	(revision 260)
+++ Dev/branches/rest-dojo-ui/client/pages/sessions.html	(revision 263)
@@ -1,21 +1,36 @@
-<div data-dojo-type="rft.ui.Page">
-    <script type="dojo/method" data-dojo-event="init">
+<div>
+    <script type="rft/method" data-rft-method="onVisit">
         var that = this;
-        require(['dojo/store/JsonRest','dojox/grid/DataGrid',
-            Â Â Â Â 'dojo/data/ObjectStore','dojo/domReady!'],
-        function(JsonRest,DataGrid,ObjectStore){
+        require(['dojo/_base/lang','dojo/_base/event','dojo/store/JsonRest','dojox/grid/DataGrid',
+        Â Â Â Â 'dojo/data/ObjectStore','rft/content','dojo/domReady!'],
+        function(lang,event,JsonRest,DataGrid,ObjectStore,content){
             var store = new JsonRest({
                 target:"../server/api.php/data/Session/",
                 idProperty: 'uid'
             });
-        Â Â Â Â var grid = new DataGrid({
-        Â Â Â Â Â Â Â Â store: ObjectStore({objectStore: store}),
-                autoWidth: true,
-                autoHeight: true,
-        Â Â Â Â Â Â Â Â structure: [
-            Â Â Â Â Â Â Â Â Â Â Â Â {name:"Title", field:"title", width: "200px"}
-        Â Â Â Â Â Â Â Â ]
-        Â Â Â Â }, that.page_sessions_grid);
-        Â Â Â Â grid.startup();
+
+            that.grid.setStore(ObjectStore({objectStore: store}));
+        
+            that.grid.on('rowclick',lang.hitch(that,function(evt){
+                var obj = evt.grid.getItem(evt.rowIndex);
+                this.form.set('value', obj);
+            }));
+
+            that.grid.on('rowdblclick',lang.hitch(that,function(evt){
+                var obj = evt.grid.getItem(evt.rowIndex);
+                content.goTo('/session',{uid:obj.uid});
+            }));
+
+            var submitHandler = lang.hitch(that,function(evt){
+                var newObj = this.form.get('value');
+                debugger;
+                // mixin newObj in obj.
+                // store.put(newObj);
+                event.stop(evt);
+                return false;
+            });
+            that.btnSave.on('click',submitHandler);
+            that.form.on('submit',submitHandler);
+        
         });
     </script>
@@ -23,5 +38,19 @@
         <div class="largeTitle">Sessions</div>
         <div class="content">
-            <div data-rft-attach-point="page_sessions_grid"></div>
+            <div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]" data-dojo-attach-point="grid"></div>
+        </div>
+
+    </div>
+
+    <div class="largeFrame" style="width: 400px;">
+        <div class="largeTitle">Details</div>
+        <div>
+            <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="form">
+                <fieldset>
+                    <label for="title" class="loginLabel">Title</label>
+                    <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
+                </fieldset>
+                <button type="submit" data-dojo-type="dijit.form.Button" data-dojo-attach-point="btnSave">Save</button>
+            </form>
         </div>
     </div>
Index: Dev/branches/rest-dojo-ui/client/pages/test1.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/test1.html	(revision 263)
+++ Dev/branches/rest-dojo-ui/client/pages/test1.html	(revision 263)
@@ -0,0 +1,18 @@
+<div data-rft-mixin="rft/ui/TestPageController">
+    <h1>External _PageController test</h1>
+    <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="doLayout: false">
+        <div data-dojo-type="dijit.layout.ContentPane" title="Sessions">
+            <div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]" data-dojo-attach-point="grid"></div>
+        </div>
+        <div data-dojo-type="dijit.layout.ContentPane" title="Details">
+            <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="form">
+                <fieldset>
+                    <label for="title" class="loginLabel">Title</label>
+                    <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
+                </fieldset>
+                <button type="submit" data-dojo-type="dijit.form.Button" data-dojo-attach-point="btnSave">Save</button>
+            </form>
+            <div data-dojo-attach-point="errors"></div>
+        </div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/pages/test2.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/test2.html	(revision 263)
+++ Dev/branches/rest-dojo-ui/client/pages/test2.html	(revision 263)
@@ -0,0 +1,18 @@
+<div>
+    <h1>No rft.ui._Page features used</h1>
+    <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="doLayout: false" style="border: 1px solid black" id="tabber">
+        <div data-dojo-type="dijit.layout.ContentPane" title="Sessions">
+            <div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="store:dojo.data.ObjectStore({objectStore: new dojo.store.JsonRest({target:'../server/api.php/data/Session/',idProperty: 'uid'})}),autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]"></div>
+        </div>
+        <div data-dojo-type="dijit.layout.ContentPane" title="Details">
+            <form data-dojo-type="dijit.form.Form">
+                <fieldset>
+                    <label for="title" class="loginLabel">Title</label>
+                    <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
+                </fieldset>
+                <button type="submit" data-dojo-type="dijit.form.Button">Save</button>
+            </form>
+            <div></div>
+        </div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/pages/test3.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/pages/test3.html	(revision 263)
+++ Dev/branches/rest-dojo-ui/client/pages/test3.html	(revision 263)
@@ -0,0 +1,92 @@
+<div>
+    <script type="rft/method" data-rft-method="onVisit">
+        var that = this;
+        require(['dojo/_base/declare','dojo/_base/lang','dojo/_base/event','rft/content',
+            'dojo/store/JsonRest','dojo/data/ObjectStore','rft/ui/_PageController','dijit/registry'],
+        function(declare,lang,event,content,JsonRest,ObjectStore,_PageController,registry){
+            (lang.hitch(that,function(){
+                this._store = new JsonRest({
+                    target:"../server/api.php/data/Session/",
+                    idProperty: 'uid'
+                });
+
+                function setEnabledRecursive(node,value) {
+                    registry.findWidgets(node).forEach(function(w){
+                        w.set('disabled',!value);
+                        setEnabledRecursive(w.domNode,value);
+                    });
+                };
+
+                setEnabledRecursive(this.form.domNode,false);
+                
+                var refreshGrid = lang.hitch(this,function(){
+                    this.grid.setStore(ObjectStore({
+                        objectStore: this._store
+                    }),'');
+                });
+                refreshGrid();
+                
+                var getSelectedItem = lang.hitch(this,function(evt){
+                    var items = this.grid.selection.getSelected();
+                    if (items.length)
+                        return items[0];
+                    return null;
+                });
+                
+                this.grid.on('rowclick',lang.hitch(this,function(evt){
+                    var obj = getSelectedItem();
+                    if ( obj) {
+                        this.form.set('value', obj);
+                        setEnabledRecursive(this.form.domNode, true);
+                    } else {
+                        setEnabledRecursive(this.form.domNode, false);
+                        this.form.reset();
+                    }
+                }));
+
+                this.grid.on('rowdblclick',lang.hitch(this,function(evt){
+                    var obj = getSelectedItem();
+                    content.goTo('/session',{
+                        uid:obj.uid
+                    });
+                }));
+
+                var submitHandler = lang.hitch(this,function(evt){
+                    this.errors.innerHTML = '';
+                    var newObj = this.form.get('value');
+                    var obj = getSelectedItem();
+                    obj = lang.mixin(obj,newObj);
+                    //this._store.put(newObj,{id:obj.uid})
+                    this._store.put(obj,{
+                        overwrite:true
+                    })
+                    .then(lang.hitch(this,function(){
+                        refreshGrid();
+                    }),lang.hitch(this,function(e){
+                        this.errors.innerHTML = e.toString();
+                    }));
+                    event.stop(evt);
+                    return false;
+                });
+                
+                this.form.on('submit',submitHandler);
+            }))();
+        });
+    </script>
+    <h1>Embedded scripts</h1>
+    <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="doLayout: false">
+        <div data-dojo-type="dijit.layout.ContentPane" title="Sessions">
+            <div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]" data-dojo-attach-point="grid"></div>
+        </div>
+        <div data-dojo-type="dijit.layout.ContentPane" title="Details">
+            <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="form">
+                <fieldset>
+                    <label for="title" class="loginLabel">Title</label>
+                    <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
+                </fieldset>
+                <button type="submit" data-dojo-type="dijit.form.Button" data-dojo-attach-point="btnSave">Save</button>
+            </form>
+            <div data-dojo-attach-point="errors"></div>
+        </div>
+    </div>
+</div>
