public String[] getParameters(final String key) { return getParameter(key).split(","); }
to
public String[] getParameters(final String key) { String val = getParameter(key); return (val != null) ? val.split(",") : null; }
?
I'm not sure what goes wrong with your code (and currently have no time to try to reproduce it), but I think the above fix is a good idea anyway. My hunch is that it has to do with the DropDownList; combining that with an upload form is something we haven't played with yet I think.
Could you let us know if that helps? And if it doesn't help, could you send this list a stacktrace (as here are several options where getParameters gets called)?
Cheers,
Eelco
Jan Mikkelsen wrote:
I have filed a bug report with a bit more information.
Hi
I am busy updating my application from 0.9.19 to 1.0, and so far I like
the changes you have made to the framework, especially
CompoundPropertyModel.
I have just run into a problem that I hope you can help with. I have an UploadForm with a FileUpload component and some other components, like Textfield. The problem is that when I submit the form, the FileUpload component parameters seem to be missing, which causes a nullpointerexception in MultipartWebRequest:
public String[] getParameters(final String key) { return getParameter(key).split(","); }
I can see that the other components are ok.
This is how I define the form (model is a CompoundPropertyModel).
private final class DetailForm extends UploadForm { public DetailForm(String name, IModel model, FeedbackPanel feedback) { super(name, model, feedback);
TextField commentField = new RequiredTextField("comment"); commentField.add(LengthValidator.max(30)); add(commentField); TextField redirectUrlField = new RequiredTextField("redirectUrl"); redirectUrlField.add(LengthValidator.max(300)); add(redirectUrlField); List imageTypes = ImageType.getAll(); DropDownChoice imageTypeChoice = new DropDownChoice("imageTypeObj", imageTypes); imageTypeChoice.add(RequiredValidator.getInstance()); add(imageTypeChoice);
TextField specialIdField = new RequiredTextField("specialId"); specialIdField.add(LengthValidator.max(10)); add(specialIdField); fileUploadField = new FileUploadField("fileInput"); fileUploadField.add(RequiredValidator.getInstance()); add(fileUploadField); add(new Link("cancelButton") { public void onClick() { redirectToInterceptPage(getSearchPage()); } }); }
Any advice would be appreciated.
Regards, Jan
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user