{\r
extend : qx.ui.container.Composite,\r
implement : [org.argeo.ria.components.IView], \r
-\r
+ include : [org.argeo.ria.session.MPrefHolder],\r
+ statics : {\r
+ riaPreferences : {\r
+ "slc.batch.delete.confirm" : {\r
+ label : "Confirm on batch deletion",\r
+ type : "boolean",\r
+ defaultValue : true\r
+ }\r
+ }\r
+ },\r
properties : \r
{\r
/**\r
toolbar : "batch",\r
callback : function(e) {\r
var sel = this.list.getSortedSelection();\r
- var modal = new org.argeo.ria.components.Modal("Confirm", null);\r
- modal.addConfirm("Are you sure you want to remove<br> the selected test"\r
- + (sel.length > 1 ? "s" : "")\r
- + " from the Batch?");\r
- modal.addListener("ok", function() {\r
- for (var i = 0; i < sel.length; i++) {\r
- this.list.remove(sel[i]);\r
- }\r
- if (!this.list.hasChildren()) {\r
- this.setBatchAgentId(null);\r
- }\r
- }, this);\r
- modal.attachAndShow();\r
+ var confirmPref = this.getRiaPreferenceValue("slc.batch.delete.confirm");\r
+ this.debug(confirmPref);\r
+ var execution = function() {\r
+ for (var i = 0; i < sel.length; i++) {\r
+ this.list.remove(sel[i]);\r
+ }\r
+ if (!this.list.hasChildren()) {\r
+ this.setBatchAgentId(null);\r
+ }\r
+ }\r
+ if(confirmPref){\r
+ var modal = new org.argeo.ria.components.Modal("Confirm", null);\r
+ modal.addConfirm("Are you sure you want to remove<br> the selected test"\r
+ + (sel.length > 1 ? "s" : "")\r
+ + " from the Batch?");\r
+ modal.addListener("ok", execution, this);\r
+ modal.attachAndShow();\r
+ }else{\r
+ execution = qx.lang.Function.bind(execution, this);\r
+ execution();\r
+ }\r
},\r
selectionChange : function(viewId, selection) {\r
if (viewId != "batch:list")\r