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 ?

 

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

 

Could this be a better solution ?

 

Keen to hear your thoughts,

 

Cameron.

 

Reply via email to