Re: create new model object of a Form from one of its FormComp values??

2008-01-25 Thread Igor Vaynberg
;} > > > > set instance of AccountBean as the model object of the form and then > > in onsubmit() { AccountBean bean=getModelObject(); Account account=new > > Account(bean.getEmail()); account.setName(bean.getName()); > > form.setModelObject(account); } > > >

Re: create new model object of a Form from one of its FormComp values??

2008-01-25 Thread infodoc
ant to e.g. create a copy constructor or utility object for copying so that you don't have your submit method littered with code to copy properties. That's largely a matter of taste though. -- View this message in context: ht

Re: create new model object of a Form from one of its FormComp values??

2008-01-22 Thread infodoc
ave your submit method littered with code to copy properties. That's largely a matter of taste though. Eelco -- View this message in context: http://www.nabble.com/create-new-model-object-of-a-Form-from-one-of-its-FormComp-values---tp14983110p15019899.html Sent from the Wicket - User mai

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Sergey Podatelev
On Jan 21, 2008 10:54 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: What Igor said: > > > bean.getdate() if you are using a bean, or just date if you are > binding to a property on the form subclass vs > (Date)textbox.getModelObject(); > Okay, I got that, thanks (: -- sp

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Eelco Hillenius
> I do understand advantages of using bean with CompoundPropertyModel, Or regular property models even. > my question was related to the situation when you are forced to create your > target object after the form is submitted. For instance, when you create > different kinds of objects based on wh

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Igor Vaynberg
its simply easier to say: bean.getdate() if you are using a bean, or just date if you are binding to a property on the form subclass vs (Date)textbox.getModelObject(); which requires you to keep a reference to the textbox component anyways. -igor On Jan 21, 2008 11:42 AM, Sergey Podatelev <[EM

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Sergey Podatelev
On Jan 21, 2008 9:25 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: Instead of a massive copy action e.g. in your onSubmit, you can > use a bean that is already populated with the values. I do understand advantages of using bean with CompoundPropertyModel, my question was related to the situatio

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Igor Vaynberg
ally i would map the form to a bean, and then in onsubmit() > transfer those properties to an instance of your domain object. > > -- > View this message in context: > http://www.nabble.com/create-new-model-object-of-a-Form-from-one-of-its-FormCom

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread infodoc
(accountBean ); //copy constructor using bean setModelObject(newAccount); RDC personally i would map the form to a bean, and then in onsubmit() transfer those properties to an instance of your domain object. -- View this message in context: http://www.nabble.com/create-new-model-object-of-a-Form-from

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Eelco Hillenius
> personally i would map the form to a bean, and then in onsubmit() > > transfer those properties to an instance of your domain object. > > > > > Igor, could you please tell in short how is this better than just get data > form the models of each component in onsubmit()? > I'm doing same thing with

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Igor Vaynberg
it gives you the advantage of being able to construct your domain objects easily: new Person(personBean); you also dont have to access the form components directly to poll their models, to me this is a plus. -igor On Jan 21, 2008 9:00 AM, Sergey Podatelev <[EMAIL PROTECTED]> wrote: > On Jan 20,

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Martijn Dashorst
Having a bean makes things explicit. Getting stuff from a text component directly is very read unfriendly. See it as a small investment in maintenance. You will thank yourself later for taking the 1 minute to generate the bean :-) But it is all a matter of taste and one can argue about that for age

Re: create new model object of a Form from one of its FormComp values??

2008-01-21 Thread Sergey Podatelev
On Jan 20, 2008 8:14 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: personally i would map the form to a bean, and then in onsubmit() > transfer those properties to an instance of your domain object. > > Igor, could you please tell in short how is this better than just get data form the models of ea

Re: create new model object of a Form from one of its FormComp values??

2008-01-20 Thread Igor Vaynberg
successful. > > Any and all suggestions/constructive criticism appreciated. Thank you in > advance for your time. > -- > View this message in context: > http://www.nabble.com/create-new-model-object-of-a-Form-from-one-of-its-FormComp-values---tp14983110p14983110.html > Sen

create new model object of a Form from one of its FormComp values??

2008-01-20 Thread infodoc
ttp://www.nabble.com/create-new-model-object-of-a-Form-from-one-of-its-FormComp-values---tp14983110p14983110.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additio