Bug #4339: Set appliance ID for export form on show

This commit is contained in:
Daniel Molina committed 2016-02-18 12:33:43 +01:00
1 parent a3dbf0ab56
commit 69fa02b796
2 files changed
+18 -2

No files matched your search

@@ -36,7 +36,19 @@ define(function(require) {
"MarketPlaceApp.export_dialog" : {
type: "custom",
call: function() {
Sunstone.showFormPanel(TAB_ID, EXPORT_DIALOG_ID, "export");
var selected_nodes = Sunstone.getDataTable(TAB_ID).elements();
if (selected_nodes.length != 1) {
Notifier.notifyMessage("Please select one (and just one) app to export.");
return false;
}
var resourceId = "" + selected_nodes[0];
Sunstone.resetFormPanel(TAB_ID, EXPORT_DIALOG_ID);
Sunstone.showFormPanel(TAB_ID, EXPORT_DIALOG_ID, "export",
function(formPanelInstance, context) {
formPanelInstance.setResourceId(context, resourceId);
});
}
},
"MarketPlaceApp.export" : {
@@ -73,6 +73,7 @@ define(function(require) {
FormPanel.prototype.constructor = FormPanel;
FormPanel.prototype.htmlWizard = _htmlWizard;
FormPanel.prototype.submitWizard = _submitWizard;
FormPanel.prototype.setResourceId = _setResourceId;
FormPanel.prototype.onShow = _onShow;
FormPanel.prototype.setup = _setup;
@@ -105,6 +106,9 @@ define(function(require) {
this.datastoresTable.idInput().attr('required', '');
}
function _setResourceId(context, resourceId) {
this.resourceId = resourceId;
}
function _submitWizard(context) {
var marketPlaceAppObj = {
@@ -112,7 +116,7 @@ define(function(require) {
"dsid" : this.datastoresTable.idInput().val()
};
Sunstone.runAction("MarketPlaceApp.export", Sunstone.getDataTable(TAB_ID).elements(), marketPlaceAppObj);
Sunstone.runAction("MarketPlaceApp.export", [this.resourceId], marketPlaceAppObj);
return false;
}
});