add parameter tab event registration

Change-Id: Ifabf5d41760a01a5a70ee52caca1a078d1729463
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
diff --git a/openo-portal/portal-lifecyclemgr/js/gsolcm.js b/openo-portal/portal-lifecyclemgr/js/gsolcm.js
index 1a94feb..d66df94 100644
--- a/openo-portal/portal-lifecyclemgr/js/gsolcm.js
+++ b/openo-portal/portal-lifecyclemgr/js/gsolcm.js
@@ -14,8 +14,20 @@
  * limitations under the License.
  */
 var templateParameters = {
-    templateName: '',
-    parameters: []
+  templateName: '',
+  parameters: []
+};
+var lcmHandler = function(){
+  this._addOwnEvents();
+};
+
+lcmHandler.prototype = {
+  _addOwnEvents : function () {
+    $('a[data-toggle="tab"]').on('show.bs.tab', this.beforeParameterTabShow);
+  },
+  beforeParameterTabShow : function (event) {
+    renderTemplateParametersTab();
+  }
 };
 
 function renderTemplateParametersTab() {
@@ -25,7 +37,7 @@
 }
 
 function fetchTemplateParameterDefinitions(parameters) {
-  var serviceTemplate = parameters.name;
+  var serviceTemplate = parameters.templateName;
   var currentServiceTemplate = $("#svcTempl").val();
   // Do not need to fetch template parameters if template do not change in UI.
   if(serviceTemplate === currentServiceTemplate) {