"deletetest" : {
shared : true,
callback : function(e){
- alert("Should delete applet selection" + this.getInstanceId());
+ //this.debug(this);
+ alert("Should delete applet selection in " + this.getInstanceId());
},
selectionChange : function(viewId, xmlNode){
if(viewId != "applet") return;
if(nodes.length){
viewSelection.addNode(nodes[0]);
}
+ this.getView().focus();
}, this);
var contextMenu = org.argeo.ria.event.CommandsManager.getInstance().createMenuFromIds(["close"]);
this.tree.setContextMenu(contextMenu);
-
+
},
/**
\r
},\r
focus : function(){\r
+ if(this.hasFocus) return;\r
this.fireEvent("changeSelection");\r
this.setDecorator(this.focusedDecorator);\r
+ this.hasFocus = true;\r
}, \r
blur : function(){\r
+ this.hasFocus = false;\r
this.setDecorator(this.blurredDecorator);\r
}\r
}\r
},
focus : function(){
+ if(this.hasFocus) return;
this.setDecorator(new qx.ui.decoration.Single(1,"solid","#065fb2"));
- qx.event.Timer.once(function(){
- this.fireEvent("changeSelection");
- }, this, 200);
+ this.fireEvent("changeSelection");
+ this.hasFocus = true;
},
blur : function(){
+ this.hasFocus = false;
this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000"));
}
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
+ 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
if(!definition.selectionChange) continue;\r
if(shared[key]){\r
var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus();\r
+ //this.debug(currentFocus);\r
if(!currentFocus) continue;\r
var sharedComm = shared[key][currentFocus.getViewId()];\r
if(sharedComm && sharedComm.selectionChange){\r
}\r
var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus();\r
if(currentFocus && currentFocus.getViewId() && callbacks[currentFocus.getViewId()]){\r
+ var currentViewId = currentFocus.getViewId();\r
+ view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById(currentViewId).getContent();\r
var binded = qx.lang.Function.bind(callbacks[currentFocus.getViewId()], view);\r
binded(event);\r
return;\r