* The main container for the org.argeo.ria.components.ViewPane instances. \r
*/\r
viewPanesContainer : {init: null},\r
+ /**\r
+ * Keeps the currently focused viewPane. \r
+ */\r
currentFocus : {init :null}\r
},\r
construct : function(){\r
* \r
* @param classObj {Clazz} The class object to instantiate\r
* @param viewPaneId {String} The unique ID of the view pane\r
+ * @param data {Mixed} Any data provided by the opener.\r
* @return {org.argeo.ria.components.IView}\r
*/\r
initIViewClass: function(classObj, viewPaneId, data){\r
viewPane.setCommands(commands);\r
org.argeo.ria.event.CommandsManager.getInstance().addCommands(commands, "view:"+viewPaneId, viewPaneId);\r
}\r
- viewPane.setContent(iView); \r
+ viewPane.setContent(iView);\r
+ this.setViewPaneFocus(viewPane);\r
return iView;\r
},\r
\r
org.argeo.ria.event.CommandsManager.getInstance().refreshCommands(viewSelection);\r
});\r
viewPane.addListener("changeFocus", function(e){\r
- for(var key in this.views){\r
- this.views[key].blur();\r
- }\r
- viewPane.focus();\r
- this.setCurrentFocus(viewPane);\r
+ this.setViewPaneFocus(e.getTarget());\r
}, this);\r
},\r
+ /**\r
+ * Sets a given viewPane as the currently focused one. Blur the others.\r
+ * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane (or TabbedViewPane) to focus on.\r
+ */\r
+ setViewPaneFocus : function(viewPane){\r
+ for(var key in this.views){\r
+ this.views[key].blur();\r
+ }\r
+ this.setCurrentFocus(viewPane);\r
+ viewPane.focus(); \r
+ },\r
/**\r
* Returns a viewPane by its unique id.\r
* @param viewPaneId {String} The unique id\r