T5: Beaneditform and Date problem
Hello, I have an object Celebrity with the fields: private long id; private String firstName; private String lastName; private Date dateOfBirth;(java.util.Date) When I use the tag: t:beaneditform t:id=celebrity/ And access the page I get the console error: No service implements the interface java.util.Date. And a Tapestry error: Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception instantiating instance of com.packtpub.celebrities.model.Celebrity (for component 'AddCelebrity:celebrity.editor'): Error invoking constructor com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation) (at Celebrity.java:23) (for service 'BeanModelSource'): No service implements the interface java.util.Date. Any ideas what I am doing wrong? Thanks, --James
Re: T5: Beaneditform and Date problem
One solution is to remove any constructor that takes arguments. Other is to write a method like @OnEvent(component = celebrity, value = Form.PREPARE) { yourEditedObject = new Celebrity(...); } Em Fri, 24 Oct 2008 16:32:37 -0300, James Sherwood [EMAIL PROTECTED] escreveu: Hello, I have an object Celebrity with the fields: private long id; private String firstName; private String lastName; private Date dateOfBirth;(java.util.Date) When I use the tag: t:beaneditform t:id=celebrity/ And access the page I get the console error: No service implements the interface java.util.Date. And a Tapestry error: Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception instantiating instance of com.packtpub.celebrities.model.Celebrity (for component 'AddCelebrity:celebrity.editor'): Error invoking constructor com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation) (at Celebrity.java:23) (for service 'BeanModelSource'): No service implements the interface java.util.Date. Any ideas what I am doing wrong? Thanks, --James -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Beaneditform and Date problem
You can also annotate the zero argument constructor with @Inject. Thiago H. de Paula Figueiredo wrote: One solution is to remove any constructor that takes arguments. Other is to write a method like @OnEvent(component = celebrity, value = Form.PREPARE) { yourEditedObject = new Celebrity(...); } Em Fri, 24 Oct 2008 16:32:37 -0300, James Sherwood [EMAIL PROTECTED] escreveu: Hello, I have an object Celebrity with the fields: private long id; private String firstName; private String lastName; private Date dateOfBirth;(java.util.Date) When I use the tag: t:beaneditform t:id=celebrity/ And access the page I get the console error: No service implements the interface java.util.Date. And a Tapestry error: Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception instantiating instance of com.packtpub.celebrities.model.Celebrity (for component 'AddCelebrity:celebrity.editor'): Error invoking constructor com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation) (at Celebrity.java:23) (for service 'BeanModelSource'): No service implements the interface java.util.Date. Any ideas what I am doing wrong? Thanks, --James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]