diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 1bdc34815b..a7b668f1b9 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -1700,7 +1700,11 @@ function fill_nic_tab_data(template_json, context){ var secgroups = template_json["SECURITY_GROUPS"].split(","); - selectSecurityGroupTableSelect(context, "vm_create_nic_"+str_nic_tab_id, secgroups); + selectSecurityGroupTableSelect( + context, + "vm_create_nic_"+str_nic_tab_id, + {ids: secgroups}); + } else { refreshSecurityGroupTableSelect(context, "vm_create_nic_"+str_nic_tab_id); } diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 797a759c69..f2ef9d7433 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -1462,7 +1462,12 @@ function fillVNetUpdateFormPanel(vnet, dialog){ vnet.TEMPLATE["SECURITY_GROUPS"].length != 0){ var secgroups = vnet.TEMPLATE["SECURITY_GROUPS"].split(","); - selectSecurityGroupTableSelect($("#vnetCreateSecurityTab", dialog), "vnet_create", secgroups); + + selectSecurityGroupTableSelect( + $("#vnetCreateSecurityTab", dialog), + "vnet_create", + { ids: secgroups }); + } else { refreshSecurityGroupTableSelect(dialog, "vnet_create"); } @@ -1693,7 +1698,8 @@ function fill_ar_tab_data(ar_json, ar_section){ ar_json["SECURITY_GROUPS"].length != 0){ var secgroups = ar_json["SECURITY_GROUPS"].split(","); - selectSecurityGroupTableSelect(ar_section, "update_ar", secgroups); + + selectSecurityGroupTableSelect(ar_section, "update_ar", {ids: secgroups}); } delete ar_json["SECURITY_GROUPS"]; diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 6fa7b664fa..726cc0059c 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -6426,9 +6426,9 @@ function retrieveSecurityGroupTableSelect(section, context_id){ } // Clears the current selection, and selects the given IDs -// ids must be a single ID, or an array of IDs for options.multiple_choice -function selectSecurityGroupTableSelect(section, context_id, ids){ - return selectResourceTableSelect(section, context_id, ids); +// opts.ids must be a single ID, or an array of IDs for options.multiple_choice +function selectSecurityGroupTableSelect(section, context_id, opts){ + return selectResourceTableSelect(section, context_id, opts); } function generateResourceTableSelect(context_id, columns, options){