JavaScript not working in IE

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

JavaScript not working in IE

Hi everyone,

I custom "activiti-transitions.js" file and working done in CHROME.

But not working in IE. Please help me. 
(In my IE - JavaScript is enabled)

FILE:

  _onClickOk: function ActivitiTransitions_onClickOk(p_obj){
         //MNT-2196 fix, disable transition button to prevent multiple execution
         p_obj.set("disabled", true);
         // determine what button was pressed by it's id
         var buttonId = p_obj.get("id");
         var transitionId = buttonId.substring(this.id.length + 1);

         // get the hidden field
         var hiddenField = this._getHiddenField();

         // set the hidden field value
         Dom.setAttribute(hiddenField, "value", transitionId);

         if (Alfresco.logger.isDebugEnabled())
            Alfresco.logger.debug("Set transitions hidden field to: " + transitionId);

         // generate the hidden transitions field
         this._generateTransitionsHiddenField();

         // attempt to submit the form
         Alfresco.util.submitForm(p_obj.getForm());
      },
      /**
       * Event handler called when a transition button is clicked.
       *
       * @method onClick
       * @param e {object} DomEvent
       * @param p_obj {object} Object passed back from addListener method
       */
      onClick: function ActivitiTransitions_onClick(e, p_obj)
      {   
	      var me = this;
		  var buttonId = p_obj.get("id");	
		  //NEW
		  if(buttonId.includes("Reject") 
		  ){
			var dashboardUri = Alfresco.util.uriTemplate("userdashboardpage",
             {
                userid: encodeURIComponent(Alfresco.constants.USERNAME)
             });
         Alfresco.util.PopupManager.displayPrompt(
             {
                title: $msg("Title),
                text: $msg("Content"),
                buttons: [
                   {
                      text: $msg("OK"),
                      handler: function onOK()
                      {
                         this.destroy();
                         me._onClickOk.call(me, p_obj)
                         window.location = dashboardUri;
                      }
                   },
                   {
                      text: $msg("Cancle"),
                      handler: function onCancel()
                      {
                         this.destroy();
                         window.location = dashboardUri;
                      },
                      isDefault: true
                   }]
             });  
		  }else{
		 //MNT-2196 fix, disable transition button to prevent multiple execution
         p_obj.set("disabled", true);
         // determine what button was pressed by it's id
         var buttonId = p_obj.get("id");
         var transitionId = buttonId.substring(this.id.length + 1);
         // get the hidden field
         var hiddenField = this._getHiddenField();
         // set the hidden field value
         Dom.setAttribute(hiddenField, "value", transitionId);
         if (Alfresco.logger.isDebugEnabled())
            Alfresco.logger.debug("Set transitions hidden field to: " + transitionId);
         // generate the hidden transitions field
         this._generateTransitionsHiddenField();
         // attempt to submit the form
         Alfresco.util.submitForm(p_obj.getForm()); 			  
		  }
      }

 

2 Replies
Highlighted
Community Manager
Community Manager

Re: JavaScript not working in IE

Hi,

Could you provide a little more information about your environment - what version of IE, any console logs, etc?

Thanks,

Eddie

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
Highlighted
Established Member II

Re: JavaScript not working in IE

.includes (also .contains) function doesn't work in IE. Play with .indexOf function, or create your own String.prototype.includes function.