diff --git a/src/sunstone/public/app/tabs/templates-tab/actions-common.js b/src/sunstone/public/app/tabs/templates-tab/actions-common.js
index ff82c07b7f..dc7b303a7f 100644
--- a/src/sunstone/public/app/tabs/templates-tab/actions-common.js
+++ b/src/sunstone/public/app/tabs/templates-tab/actions-common.js
@@ -82,8 +82,8 @@ define(function(require) {
var elementId = request.request.data[0][0].toString();
Sunstone.getDataTable(TAB_ID).deleteElement(elementId);
},
- elements: function() {
- return Sunstone.getDataTable(TAB_ID).elements();
+ elements: function(opts) {
+ return Sunstone.getDataTable(TAB_ID).elements(opts);
},
error: Notifier.onError,
notify: true
@@ -106,8 +106,8 @@ define(function(require) {
callback : function(request, response) {
Sunstone.runAction(RESOURCE+".show", req.request.data[0][0]);
},
- elements: function() {
- return Sunstone.getDataTable(TAB_ID).elements();
+ elements: function(opts) {
+ return Sunstone.getDataTable(TAB_ID).elements(opts);
},
error: Notifier.onError,
notify: false
@@ -127,8 +127,8 @@ define(function(require) {
callback : function(request, response) {
Sunstone.runAction(RESOURCE+".show", req.request.data[0][0]);
},
- elements: function() {
- return Sunstone.getDataTable(TAB_ID).elements();
+ elements: function(opts) {
+ return Sunstone.getDataTable(TAB_ID).elements(opts);
},
error: Notifier.onError,
notify: false
@@ -157,8 +157,8 @@ define(function(require) {
Notifier.notifyCustom(Locale.tr("VM created"), " ID: " + response, false);
},
- elements: function() {
- return Sunstone.getDataTable(TAB_ID).elements();
+ elements: function(opts) {
+ return Sunstone.getDataTable(TAB_ID).elements(opts);
},
error: function(request, response){
// without tab id param to work for both templates and vms tab
diff --git a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
index 36431b2ae5..186c67a4de 100644
--- a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
+++ b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
@@ -114,7 +114,10 @@ define(function(require) {
}
function _onShow(context) {
- var sel_elems = Sunstone.getDataTable(this.tabId).elements();
+ var sel_elems = Sunstone.getDataTable(this.tabId).elements({names: true});
+
+ this.setNames(sel_elems);
+
//show different text depending on how many elements are selected
if (sel_elems.length > 1) {
$('.clone_one', context).hide();
@@ -123,7 +126,7 @@ define(function(require) {
} else {
$('.clone_one', context).show();
$('.clone_several', context).hide();
- $('input[name="name"]', context).val('Copy of ' + OpenNebulaTemplate.getName(sel_elems[0]));
+ $('input[name="name"]', context).val('Copy of ' + sel_elems[0].name);
};
$("input[name='name']", context).focus();
diff --git a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone/html.hbs b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone/html.hbs
index 25de7b7b53..df7c0c7978 100644
--- a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone/html.hbs
+++ b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone/html.hbs
@@ -18,6 +18,7 @@
+