> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:wicket-develop-
> [EMAIL PROTECTED] On Behalf Of Eelco Hillenius
> Sent: Wednesday, 27 July 2005 2:37 AM
> To: [email protected]
> Subject: Re: [Wicket-develop] Forms and MultiPart Forms
> 
> Cameron Braid wrote:
> 
> > I have implemented a grid edit component, that subclasses Form.
> >
> > Now, I wish to be able to handle multipart forms, which isn't straight
> > forward, since UploadForm is a subclass of Form.
> >
> > I am trying to work the UploadForm.process() code into my GridForm
> > component, using delegation instead of subclassing. I have run into a
> > snag.
> >
> > The MultipartWebRequest takes an UploadForm as an argument. It only
> > uses the max upload size property, so can this parameter be changed to
> > be the size itself, instead of the upload form instance ?
> >
> 
> It's probably even better to make this a property of MultiPartRequest
> and remove the constructor argument.
> 
[Cameron Braid] Nope - can't do - the maxSize property is required in the
MultiPartRequest  constructor because the request is parsed immediately.

> > Its either this, or I create my own copy of MultipartWebRequest as well
> !
> >
> > Any specific reasons why multi part forms weren't implemented using
> > delegation instead of subclassing ?
> >
> > The Form class could just have 2 setters :
> >
> > setMultiPart(Boolean)
> >
> > setMaxUploadSize(int)
> >
> > It could then optionally wrap the request with a multipart reques
> > Form.process, based on the multipart flag.
> >
> > It could optionally set the enctype attribute in onComponentTag
> >
> 
> I think that decission was made because they have different behaviour/
> are used for different things. I don't have a very strong meaning about
> it currently. What do you like better about delegation and how does it
> solve specific problems you have now?
> 

Yes and No... I think that just because a file upload input contains non
string data, it shouldn't require a special type of form - just because the
http protocol has dictated that this is technically how this is done.

Fair enough that we want to prevent certain forms from receiving multipart
data, and to be able to constrain the size of this data, however when it
comes down to it .. it's a form.  

In my mind, all forms could potentially be upload forms.  

In my case - I have implemented a few subclasses of Form 

- an EntityForm which automatically builds a model from a data source
- a GridForm which automatically builds a list model from a datasource 
Both of which have custom onSubmit and validate overrides.

Now - I will need to create my own subclass of wicket.m.h.Form that uses
delegation to handle the uploading side of things, then subclass it with
EntityForm and GridForm - and possibly any future custom form
implementations that I have.  Hence the w.m.h.UploadForm component is not
useful.

I would assume that others would want to create their own subclasses of
wicket.m.h.Form, and will probably one day want to support file uploads with
them too.

Cameron

 
> Eelco
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Wicket-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to