Need to call the Action inside the function

I’m doing the action for while click on the download icon in the folder type. It have to download as zip. For that they wrote already in the java and created a service for that as like below:

    id: 'core:downloadZip',
    invoke: function (context) {
        var mos = Ember.get(context, 'managedObjects') || [Ember.get(context, 'managedObject')];

    var moIdResult = [];
    var moArray ='';
    mos.forEach(function (mo) {
        moArray = moIdResult.push(mo.get(''));
          type: 'get',
          service: 'content/zip',
          iframe: true,
          data: {
            coreId: moIdResult
      }).done(function (response) {
  },isValid: rules.all(
          rules.any(rules.isMO, rules.areMOs),

In that service: ‘content/zip’ doing that action as download as zip from the java file. But when I’m calling the above code in the same file as like below:

click: function(e) {
                  var type = this.get('content.kind');
                  if(type == 'Folder'){
                      Core.Action('core:downloadZip', context);

When I’m calling as like above, its not taking and moreover not even showing any error in console. Can anybody please provide me suggestion on this. I’m new to the Ember and I’m using ember 1.4.0 version. Thanks in advance

Hi @boo, to debug what’s going on, I suggest putting a breakpoint into your click function, firstly just to see if it’s running at all, and secondly if it is running to check what type you are getting from your content.kind.

If your click is not running, please share more detail about which file it appears in, and what the corresponding template says.

1 Like