Hi,

If you use the component provided to upload attachments, everything is linked 
automatically.

An exemple using an AjaxUpload in a user edit page:
<wo:ERAttachmentFlexibleUpload attachment = "$usager.photo" editingContext = 
"$usager.editingContext" selectFileLabel = "button.selectionnerPhoto" 
succeededFunction = "function(){AUC.update('editorContainer');}" 
succeededAction = "$photoSaved" />

If you create then programmatically, you will get an ERAttachement EO that you 
need to assign to your "Master" object attachement relationship. There is no 
universal rule for the Own Destination, it depend on your usage like any other 
relationship. ERAttachement are EO like all others for you model.

Regards,

Samuel


> Le 10 janv. 2017 à 01:18, Kwasi O-Ahoofe <koa...@icloud.com> a écrit :
> 
> Has anyone been able to successfully implement ERAttachment with StorageType 
> = “db”? The following is my question/difficulty:
> 
> I am still wrestling with ERAttachment ‘magic’..!! I can finally ‘easily’ 
> upload attachment files and populate <ERAttachment/ERAttachmentData> database 
> entities <i.e: with ERDatabaseAttachment.STORAGE_TYPE =“db” >, but I can’t 
> figure/find out the magic that’s required to set the Owning EO’s 
> <MasterObject’s> Attribute Value for the to-one ‘destination’ 
> RelationshipKey. 
> That is: when and how is the JOIN attribute VALUE SET by the attachment 
> <ERAttachment>, so that when the owning EO (masterObject) is retrieved the 
> appropriate attachment is located and rendered?
> 
>       RelationshipKey myAttachment ====>>  MasterObject {attachmentID} 
> ————>ERAttachment {id}
> 
>               such that: MasterObject.myAttachment() = stored_attachment
> 
> In short, the correct corresponding attachment is retrieved ONLY if:   
>               MasterObject. attachmentID() = ERAttachment.id()
> 
> But can’t see when/where MasterObject. attachmentID is set!
> 
> Can’t find it in documentation or Javadoc (api: Project Wonder 7.0.0-SNAPSHOT)
> 
> Any help will be appreciated.. Thank you!
> 
> PS: The attachments are created and saved in the DB but the attachmentID is 
> NOT set in the owning/masterObject !!!
> 
> Kwasi
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to