Re: Prefill form not model?

2009-09-13 Thread Martin Makundi
Hi! > having read the thread I didn't get why you can not modify the object > itself. Now I remember the reason: modifying the object itself with default values, it will be reflected throughout the whole EntityManager (i.e., other users will see a prefilled value that has not been stored!!). Tha

Re: Prefill form not model?

2009-07-08 Thread Johan Compagner
The hack is awful Just have a detachable model that holds on first render the defaults then when a submit is done populate the object (another) that you want On 07/07/2009, Martin Makundi wrote: > The hack is cleaner > > 2009/7/7 James Carman : >> On Tue, Jul 7, 2009 at 10:51 AM, Martin Makundi

Re: Prefill form not model?

2009-07-08 Thread Martin Makundi
>> having read the thread I didn't get why you can not modify the object >> itself. Actually.. the only GOOD reason I can come up with is that by setting the default value into RAWINPUT, it will be validated when the form is submitted. ** Martin --

Re: Prefill form not model?

2009-07-08 Thread Martin Makundi
>>> Is there a better way? >>>> >>>> ** >>>> Martin >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wi

Re: Prefill form not model?

2009-07-08 Thread Vladimir K
tional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: u

Re: Prefill form not model?

2009-07-07 Thread Martin Makundi
> In your opinion.  Hibernate supports merging (if that's what you're using). > Why not edit the object in a detached state (not in the session)? > Then, when you want to update it, you call update()? If there was only one simple object yes... but there is a whole collaboration diagram of objects.

Re: Prefill form not model?

2009-07-07 Thread Igor Vaynberg
write a model that returns your default value in getobject and updates the object in setobject -igor On Tue, Jul 7, 2009 at 6:57 AM, Martin Makundi wrote: > Hi! > > What is the proper way to prefill a wicket form (not poke the model > before submit!!!)? > > I have used a hack: > >      Field rawI

Re: Prefill form not model?

2009-07-07 Thread James Carman
On Tue, Jul 7, 2009 at 10:59 AM, Martin Makundi wrote: > > The hack is cleaner In your opinion. Hibernate supports merging (if that's what you're using). Why not edit the object in a detached state (not in the session)? Then, when you want to update it, you call update()? If the edit never suc

Re: Prefill form not model?

2009-07-07 Thread Martin Makundi
The hack is cleaner 2009/7/7 James Carman : > On Tue, Jul 7, 2009 at 10:51 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> > Typically to prefill a form you have the backing model object have >> > sensible defaults.  i.e., a form that edits a person is given a >> > person, a

Re: Prefill form not model?

2009-07-07 Thread James Carman
On Tue, Jul 7, 2009 at 10:51 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > > Typically to prefill a form you have the backing model object have > > sensible defaults. i.e., a form that edits a person is given a > > person, and the person object has it's gender set to "male" as

Re: Prefill form not model?

2009-07-07 Thread Martin Makundi
> Typically to prefill a form you have the backing model object have > sensible defaults.  i.e., a form that edits a person is given a > person, and the person object has it's gender set to "male" as a > default - that is reflected in your form when it is rendered. The problem is that it is not a

Re: Prefill form not model?

2009-07-07 Thread Jeremy Thomerson
Typically to prefill a form you have the backing model object have sensible defaults. i.e., a form that edits a person is given a person, and the person object has it's gender set to "male" as a default - that is reflected in your form when it is rendered. otherwise, you could call setModelObject

Prefill form not model?

2009-07-07 Thread Martin Makundi
Hi! What is the proper way to prefill a wicket form (not poke the model before submit!!!)? I have used a hack: Field rawInputField = FormComponent.class.getDeclaredField("rawInput"); rawInputField.setAccessible(true); rawInputField.set(component, description); Is there a bette