create a bean to represent the form, then in form's onsubmit create
the object and populate it from the bean
-igor
On Jan 24, 2008 8:35 AM, Brad Fritz <[EMAIL PROTECTED]> wrote:
>
> Greetings,
>
> I am new to Wicket and having some trouble binding a Wicket Form
> component to an object that does not have a default constructor and
> does not follow the javabean pattern. I have read and re-read the
> wiki information on models and checked the mailing list archives but
> haven't made much progress so far. (I am using Wicket 1.3.0.)
>
> My object looks like this:
>
> public class Foo {
>
> private Long id1;
> private Long id2;
> private String bar;
>
> public Foo(Long id1, Long id2) {
> this.id1 = id1;
> this.id2 = id2;
> }
>
> public Long getId1() { return this.id1; }
> public Long getId2() { return this.id2; }
>
> public String getBar() { return this.id2; }
> public void setBar(String bar) { this.bar = bar; }
> }
>
> My form will contain RequiredTextField components for id1 and id2 and
> a TextField for bar.
>
> Can someone point me in the right direction for binding the form
> values to a new instance of Foo?
>
> I would be happy to add an example to the wiki after I figure out the
> solution if anyone thinks that would be helpful.
>
> Thanks for any help!
>
> --Brad
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHmL5W9ddscHX7RVsRAlTXAJwKYGnV1p4/xARNMlxKiEMZPtGVswCeP74k
> dNltRLJR24KytsuoLxajnvU=
> =3WyV
> -----END PGP SIGNATURE-----
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]