On 23.11.2005, at 16:34 Uhr, David Teran wrote:

myUploadComponent extends ERDCustomEditComponent

just adding a description string, a WOFileUpload and a submit button (for the fileupload). Then i modify a rule:

task='edit' and entity.name='Whatever' -> displayPropertyKeys = '(key1, key2, fileUpload, key3, key4)'

task='edit' and entity.name='Whatever' and propertyKey = 'fileUpload' -> componentName = myUploadComponent

This works fine. Adding a little bit more magic and you can reuse the component for -all- fileuploads.

Okay, I have tested this because I was interested in doing it "the right way" with a property level component and I just can't get it working correctly.

I have created a component inheriting from ERDCustomEditComponent. This has just a WOFileUpload and a submit button, a method for the submit (which isn't actually called :-(), two conditionals to provide the fileupload only if the data property is null and at least a hyperlink with a "removeData" action.

I have also created a rule to add the "enctype" to the enclosing form.

Now - if I have this setup, my own "submitData" action IS NOT called. If I don't have the rule setting the enctype, my own action IS called but the file is not transferred. Okay, I expected the second but not the first.

So, I could have lived with my own action not being called and do all processing in the EO (as it is the better place to do). But the behaviour I get now, is not, what I expect: I have set the mimetype and filename attribute to be non null in my file entity. When I click on "my" submit button which doesn't call "my" action but another one, I get the error message that I have to provide input in filename and mimetype - but they ARE SET when the page returns! When I remove the "not null" constraint from my model, the mimetype isn't set at all.

Some hints where I can look what I'm doing wrong?

I use Wonder (a few weeks old), WebObjects 5.2.4 on Tiger.

cug

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

This email sent to [email protected]

Reply via email to