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.
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?
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