How to attach file using Lightning Revisited for v37

I am attempting to implement a file upload in lightning using API version 37 and this solution:

How to attach file using Lightning for Salesforce1?

That solution unfortunately makes a call to $A.run which has been deprecated.

I have tried enqueuing the action without a wrapper as follows.

OLD:

$A.run(function() {     $A.enqueueAction(action);  }); 

NEW:

$A.enqueueAction(action);  

However, the upload does not start immediately. In fact, if I do nothing after clicking submit, then the upload does not start at all. I can coax the upload into starting by either resizing the window or enqueueing another action, but this seems like a waste. I believe this is caused by the Boxcarred Action behavior when using $A.enqueueAction.

Has anybody else experienced this and is there a known workaround that forces an action to execute immediately?

Replay

Category: javascript Time: 2016-07-28 Views: 4

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.193 (s). 13 q(s)