Re: RES: FileUploadField usage changed in 1.4 rc-1?
This seems to result in org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: org.apache.wicket.util.io.DeferredFileOutputStream I must implement the "detach()" method for the dummy fileUpload model: form.add(fileUploadField = new FileUploadField(PHOTO_UPLOAD_ID, new Model() { /** * @see org.apache.wicket.model.Model#detach() */ @Override public void detach() { setObject(null); } })); This really seems like an overkill to me, previously this worked much better ;) ** Martin 2008/11/19 Marat Radchenko <[EMAIL PROTECTED]>: > Does it mean that FileUploadField now stores FileUpload in model? > 2008/11/19, Erik van Oosten <[EMAIL PROTECTED]>: >> Yeah, I run into the same thing. >> >> Just pass FileUploadField an empty model: new Model() >> >> Regards, >>Erik. >> >> >> Bruno Cesar Borges schreef: >> >> > Yes, you need to set a Model object into FileUploadField. :-) >> > >> > Bruno >> > >> > >> > >> > >> >> >> -- >> Erik van Oosten >> http://www.day-to-day-stuff.blogspot.com/ >> >> >> >> - >> To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: FileUploadField usage changed in 1.4 rc-1?
Does it mean that FileUploadField now stores FileUpload in model? 2008/11/19, Erik van Oosten <[EMAIL PROTECTED]>: > Yeah, I run into the same thing. > > Just pass FileUploadField an empty model: new Model() > > Regards, >Erik. > > > Bruno Cesar Borges schreef: > > > Yes, you need to set a Model object into FileUploadField. :-) > > > > Bruno > > > > > > > > > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: FileUploadField usage changed in 1.4 rc-1?
Strange quirk.. someone removed the preceding hack from within. Is there some flaw in the FileUploadFIeld design? ** Martin 2008/11/19 Erik van Oosten <[EMAIL PROTECTED]>: > Yeah, I run into the same thing. > > Just pass FileUploadField an empty model: new Model() > > Regards, > Erik. > > > Bruno Cesar Borges schreef: >> >> Yes, you need to set a Model object into FileUploadField. :-) >> >> Bruno >> >> >> > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: FileUploadField usage changed in 1.4 rc-1?
Yeah, I run into the same thing. Just pass FileUploadField an empty model: new Model() Regards, Erik. Bruno Cesar Borges schreef: Yes, you need to set a Model object into FileUploadField. :-) Bruno -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: FileUploadField usage changed in 1.4 rc-1?
Yes, you need to set a Model object into FileUploadField. :-) Bruno -Mensagem original- De: Martin Makundi [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 19 de novembro de 2008 14:33 Para: users@wicket.apache.org Assunto: FileUploadField usage changed in 1.4 rc-1? Hi! My FileUploadField worked fine before: dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO)); After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes. Am I doing something wrong or is there a bug in rc-1? Caused by: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) ERROR - RequestCycle - there was an error cleaning up target java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647) at org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175) at org.apache.wicket.Component.detach(Component.java:1119) The 1.4-m-3 code avoided the nullpointer like this: @Override public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setDefaultModelObject(getConvertedInput()); } } However, this "hasExplicitModel" is not there anymore in 1.4-rc1 No documentation seems to have changed.. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** "Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas." "Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel." *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]