Appreciate your help.

I tried to create a bean and use a copy ctor as Eelco suggested.  Expect
that would work well.

I ran into problems with that because of some read-only fields of
superclasses of Account necessitated by my design.   Therefore, a copy ctor
was not possible without breaking encapsulation of those superclasses, which
I didn't want to do.  What worked for me - not necessarily a better or
simpler solution - was to create a protected constructor of Account that
didn't require the email address of the admin.  I create this by Reflection
and set it as model object of the Form, where it acts just like the bean
suggested by Eelco.  It gets updated normally by the FormComponents and
everything seems to work well.  

In sum, instead of creating a new model object from a value of the Form upon
Form submission, I instead created a new protected constructor that creates
an (incomplete but temporary) object which acts like a bean.  Perhaps not
the most elegant solution, but works given other constraints in my overall
design.

RDC


What Igor said:

and it is also more elegant 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.

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 mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to