Re: ERAttachment uploaders pain
Re: ERAttachment uploaders pain
- Subject: Re: ERAttachment uploaders pain
- From: Paul Hoadley <email@hidden>
- Date: Wed, 06 Apr 2016 09:25:34 +0930
Hi Tim,
I’ve tried pretty much every uploader in the ERAttachment package with poor results. I guess the only option is to transition to "_javascript_ guru.” I spent a LOT of time with ERAttachmentFlexibleUpload - and never could get it to display anything but “Upload Starting …” I tried every post-processing binding I could find.
Firstly, I can sympathise. It’s a minefield.
Now simplifying to ERAttachmentUpload (with ajax). No matter what I try I cannot get the component to update anything after completion - which is similar to the problems with the flexible version. For simplicity, I reduced to one AUC (“fullPageContainer") that wraps all the page content.
I can’t vouch for that component, but I can tell you that we’ve got ERAttachmentFlexibleUpload working in a couple of projects. It might be worth giving it another look. Here’s an example of working usage:
<wo:ERAttachmentFlexibleUpload configurationName="JobDocument" attachment="$nextJobDocument.attachment" editingContext="$nextJobDocument.editingContext" autoSubmit="$true" finishedAction="$finished" finishedFunction="function(){documentContainerUpdate();}" />
We’re using S3 here, and ‘configurationName’ points to some properties for this particular entity:
er.attachment.JobDocument.s3.accessKeyID= er.attachment.JobDocument.s3.secretAccessKey= er.attachment.JobDocument.s3.bucket= er.attachment.JobDocument.s3.host= er.attachment.JobDocument.s3.acl=
All of those have appropriate values set, obviously. nextJobDocument is an ivar containing a JobDocument “cover entity”, which itself has a relationship to ERAttachment. (That is, JobDocument.attachment() returns an ERAttachment.) The finished() method just creates a new JobDocument and assigns it to nextJobDocument—all of this occurs before the component tries to get the ERAttachment via nextJobDocument.attachment(), so it all happens just in time. finishedFunction just calls some _javascript_ to updating the containing AUC.
And that’s it. There’s no other magic. Try it out.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden