You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Ferreira Castro <df...@gmail.com> on 2009/04/01 20:46:55 UTC

Transformin a form into a component

I have a doubt about componentizing a Form.

If I create a class, MyForm.java, that extends Form
Inside of it I declare all the form componets.

After that I create the markup with all the components present on
MyForm.java.  I call it MyForm.html

If I want to use it on a page, like MyPage for instance, how should I
declare the form component on my page markup?
It will be like that?  Or are there any more steps to take to be able to
componentize a form?

MyPage.html
...
<form wicket:id="myform"></form>

MyPage.java
private final MyForm myform = new myForm("myform");
...
this.add(myform);

?

-- 
"Two rules to succeed in life:
1 - don´t tell people everything you know."
--------
We shall go on to the end.
We shall fight in France
We shall fightover the seas and oceans.
We shall fight with growing confidence and growing strength in the air.
We shall defend our island whatever the cost may be
We shall fight on beaches, we shall fight on the landing grounds,
We shall fight in the fields and in the streets,
We shall fight on the hills.
We shall never surrender.
Winston Churchill

Re: Transformin a form into a component

Posted by Daniel Ferreira Castro <df...@gmail.com>.
Thanks, it worked. :)

On Wed, Apr 1, 2009 at 3:49 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> put it into a panel
>
> -igor
>
> On Wed, Apr 1, 2009 at 11:46 AM, Daniel Ferreira Castro
> <df...@gmail.com> wrote:
> > I have a doubt about componentizing a Form.
> >
> > If I create a class, MyForm.java, that extends Form
> > Inside of it I declare all the form componets.
> >
> > After that I create the markup with all the components present on
> > MyForm.java.  I call it MyForm.html
> >
> > If I want to use it on a page, like MyPage for instance, how should I
> > declare the form component on my page markup?
> > It will be like that?  Or are there any more steps to take to be able to
> > componentize a form?
> >
> > MyPage.html
> > ...
> > <form wicket:id="myform"></form>
> >
> > MyPage.java
> > private final MyForm myform = new myForm("myform");
> > ...
> > this.add(myform);
> >
> > ?
> >
> > --
> > "Two rules to succeed in life:
> > 1 - don´t tell people everything you know."
> > --------
> > We shall go on to the end.
> > We shall fight in France
> > We shall fightover the seas and oceans.
> > We shall fight with growing confidence and growing strength in the air.
> > We shall defend our island whatever the cost may be
> > We shall fight on beaches, we shall fight on the landing grounds,
> > We shall fight in the fields and in the streets,
> > We shall fight on the hills.
> > We shall never surrender.
> > Winston Churchill
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
"Two rules to succeed in life:
1 - don´t tell people everything you know."
--------
We shall go on to the end.
We shall fight in France
We shall fightover the seas and oceans.
We shall fight with growing confidence and growing strength in the air.
We shall defend our island whatever the cost may be
We shall fight on beaches, we shall fight on the landing grounds,
We shall fight in the fields and in the streets,
We shall fight on the hills.
We shall never surrender.
Winston Churchill

Re: Transformin a form into a component

Posted by Igor Vaynberg <ig...@gmail.com>.
put it into a panel

-igor

On Wed, Apr 1, 2009 at 11:46 AM, Daniel Ferreira Castro
<df...@gmail.com> wrote:
> I have a doubt about componentizing a Form.
>
> If I create a class, MyForm.java, that extends Form
> Inside of it I declare all the form componets.
>
> After that I create the markup with all the components present on
> MyForm.java.  I call it MyForm.html
>
> If I want to use it on a page, like MyPage for instance, how should I
> declare the form component on my page markup?
> It will be like that?  Or are there any more steps to take to be able to
> componentize a form?
>
> MyPage.html
> ...
> <form wicket:id="myform"></form>
>
> MyPage.java
> private final MyForm myform = new myForm("myform");
> ...
> this.add(myform);
>
> ?
>
> --
> "Two rules to succeed in life:
> 1 - don´t tell people everything you know."
> --------
> We shall go on to the end.
> We shall fight in France
> We shall fightover the seas and oceans.
> We shall fight with growing confidence and growing strength in the air.
> We shall defend our island whatever the cost may be
> We shall fight on beaches, we shall fight on the landing grounds,
> We shall fight in the fields and in the streets,
> We shall fight on the hills.
> We shall never surrender.
> Winston Churchill
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org