label : "Confirm on batch deletion",\r
type : "boolean",\r
defaultValue : true\r
+ },\r
+ "slc.batch.autoclear" : {\r
+ label : "Autoclear batch on execution",\r
+ type : "boolean",\r
+ defaultValue : false\r
}\r
}\r
},\r
menu : "Launcher",\r
toolbar : "batch",\r
callback : function(e) {\r
- if (this.getBatchAgentId()) {\r
- this.executeBatchOnAgent(this.getBatchAgentId());\r
+ var batchAgentId = this.getBatchAgentId();\r
+ if (!batchAgentId) {\r
+ return; \r
}\r
+ var prefName = "slc.batch.autoclear";\r
+ var prefValue = this.getRiaPreferenceValue(prefName);\r
+ if(prefValue !== null){\r
+ this.executeBatchOnAgent(batchAgentId, prefValue);\r
+ return;\r
+ }\r
+ var modal = new org.argeo.ria.components.Modal("Clear?", null);\r
+ modal.addYesNoReminder("Do you want to clear the batch automatically after execution?", prefName);\r
+ modal.addListener("cancel", function(e){\r
+ this.executeBatchOnAgent(batchAgentId, false);\r
+ }, this);\r
+ modal.addListener("ok", function(e){\r
+ this.executeBatchOnAgent(batchAgentId, true);\r
+ }, this);\r
+ modal.attachAndShow(); \r
},\r
command : null\r
},\r
* @param agentUuid\r
* {String} The id of the target agent\r
*/\r
- executeBatchOnAgent : function(agentUuid) {\r
+ executeBatchOnAgent : function(agentUuid, clearBatch) {\r
var selection = this.list.getChildren();\r
if (!selection.length)\r
return;\r
command.execute();\r
}\r
}, this, 2000);\r
+ if(clearBatch){\r
+ req.addListener("completed", function(e){\r
+ this.list.removeAll();\r
+ }, this);\r
+ } \r
}catch(e){\r
this.error(e); \r
}\r