cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [cforms] Editing existing list of uploads
Date Sat, 03 Jul 2004 20:38:32 GMT
Joerg Heinicke wrote:

> This thread on users list was about implementing the setValue() method 
> on the upload widget. The use case is - as the subject says - editing 
> existing list of uploads. The complete thread can be found at 
> What has 
> been the reason for not implementing the method besides a missing use 
> case? No security reason came to my mind. What about implementing it 
> the most simple way:
> public void setValue(Object object) {
>     if (!(object instanceof Part)) {
>         throw new RuntimeException("not a part");
>     }
>     this.part = (Part) object;
> }

That makes sense. This allows for example forms that edit some data with 
binary attachements to display the existing attachments and newly added 
ones in a uniform way.

However, as outlined in the discussion, the form binding will have to 
take care of distinguishing new and existing attachments, and also 
existing attachments that were deleted. But that's another problem.

Something I've been thinking about also is a way to make the uploaded 
parts accessible from the browser. That would allow e.g. to display a 
preview of uploaded images.

For low, let's add Upload.setValue() !


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message