Re: ERMD2WEditAttachment in Edit page only works once.
Re: ERMD2WEditAttachment in Edit page only works once.
- Subject: Re: ERMD2WEditAttachment in Edit page only works once.
- From: Johan Henselmans <email@hidden>
- Date: Tue, 26 Oct 2010 09:56:51 +0200
Op 21 okt 2010, om 19:35 heeft David Holt het volgende geschreven:
>
> On 2010-10-21, at 1:55 AM, Johan Henselmans wrote:
>
>>
>> On 20 okt 2010, at 18:35, David Holt wrote:
>>
>>> Hi Johan!
>>>
>>> On 2010-10-20, at 7:27 AM, Johan Henselmans wrote:
>>>>
>>>>
>>>>
>>>> I tried to find out why this happens and it seems that ERFileAttachmentProcessor.java does not get a configurationName passed on.
>>>>
>>>> Which leads to the following questions:
>>>>
>>>> Is it possible to have two uploadblobs in one form with ERMD2WEditAttachment?
>>>
>>> It should be. You need two different configuration names as you've done.
>>>
>>>> Why can't I set the properties of two separate ERAttachments in the Properties file?
>>>
>>> I don't believe the properties are where your problem lies. If you remember from the screencast, you need to set three bindings on an upload - configurationName, editingContext, and attachment. If you have multiple uploaders on a pageConfiguration, then it seems that you'll need to use the rules to tell the component the bindings.
>>>
>>> 100 : (task = 'edit' and entity.name = 'Document' and propertyKey = 'attachedFile') => attachmentConfigurationName = "Document.attachedFile" [com.webobjects.directtoweb.Assignment]
>>>
>>> David
>>>
>>
>> OK, I added the rules
>> properyKey= picturebig -> attachmentConfigurationName = ShowInfo.picturebig,
>> and
>> properyKey= picturesmall -> attachmentConfigurationName = ShowInfo.picturesmall
>
> Maybe you're misnaming or mistyping something?
Sorry, I just meant to be less distracting by the names.
>
> In the properties you listed in your previous email you're calling your configuration ShowInfo.showpicturebig and ShowInfo.showpicturesmall
>
> Are you sure the configurations listed in the properties are named *exactly* the same as they are configured in the Rules?
I think I have done that. I am getting errors in the Safari Console;
ReferenceError: Can't find variable: AFUICShowInfo
ReferenceError: Can't find variable: AFUOCShowInfo
ReferenceError: Can't find variable: AFEUCShowInfo
ReferenceError: Can't find variable: AFUICShowInfo
ReferenceError: Can't find variable: AFUOCShowInfo
ReferenceError: Can't find variable: AFEUCShowInfo
3.0.3.5.1.2.3.0.1.0:937ReferenceError: Can't find variable: AFUICShowInfo
It seems to be overhere:
</div><script>AUC.registerPeriodic('AFUICShowInfo.showpicturebig',true,true,{asynchronous:false, evalScripts:true, frequency:2.0, method:'get'});AUC.register('AFUICShowInfo.showpicturebig', {asynchronous:false, frequency:2.0});</script>
<script type="text/javascript"><!--
AFU.create('ShowInfo.showpicturebig', 'AFUUBShowInfo.showpicturebig', {action:'/cgi-bin/WebObjects/TheaterBeheer3.woa/upload', data:{wosid:'dgWFL4lcwGgIYkNtiwz1JM', id:'ShowInfo.showpicturebig'}, name:'AFUUNShowInfo.showpicturebig', iframeId:'AFUIFShowInfo.showpicturebig', onSubmit:function(file, extension){ AFUICShowInfo.showpicturebigPeriodicalUpdater.start(); }, onComplete:function(file, extension){ AFUICShowInfo.showpicturebigStop(); AFUICShowInfo.showpicturebigUpdate(); }});
//--></script>
There things went wrong...
After a flash of dementia, I removed the rules
>> properyKey= picturesmall -> attachmentId = ShowInfo.showpicturesmall,
>> properyKey= picturebig -> attachmentId = ShowInfo.showpicturebig,
and refreshed the project.
everything seems to be well now.
Thanks for the moral guidance!
>
> d
>
>>
>> to the previous rules:
>> properyKey= picturebig -> componentName = ERMD2WEditAttachment,
>> properyKey= picturesmall -> componentName = ERMD2WEditAttachment,
>>
>>
>> uploading the first item (picturebig) worked, apart from the following error:
>> There is no element on this page with the id "AFUIC_0".
>>
>> The second ERMD2WEditAttachment still came with the error:
>> There is no 'er.attachment.null.file.filesystemPath' or 'er.attachment.file.filesystemPath' property set.
>>
>> after adding the rules:
>> properyKey= picturesmall -> attachmentId = ShowInfo.picturesmall,
>> properyKey= picturebig -> attachmentId = ShowInfo.picturebig,
>>
>> I did not get any errors uploading pictures to the form for the first time, but clicking on the edit button in the ERMD2WEditAttachment, I could select a picture for the bottom component (picturesmall), but for the component above it, I did not get a filebrowser window, the original picture disappeared, but saving the complete entity and opening it again did show the old picture in the first ERMD2WEditAttachment.
>>
>> Is there anything else I have to set?
>>
>> I assume I do not have to set the editing Context for D2W?
>>
>>
>>
>>
>>>
>>>>
>>>>
>>>> Johan Henselmans
>>>> email@hidden
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>
>> Johan Henselmans
>> email@hidden
>>
>>
>>
>
Johan Henselmans
email@hidden
_______________________________________________
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