You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by tubin gen <fa...@gmail.com> on 2009/07/24 22:47:27 UTC

use a lable in several palces in a page

I created a label and I wabnt to use this label in seeral places in
page , is it allowed , right now I getting exception

 [Component id = documentType] has the same wicket:id as another
component already added at the same level

so If want to show the same text  at 5 different places in markup do I
have to create 5 label objects with the same model ?

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


Re: use a lable in several palces in a page

Posted by pete swulius <ps...@gmail.com>.
>From what I've read about wicket, you must create the label multiple times.
Here's a recent discussion on that topic with some good reasons why:

http://www.nabble.com/HTML-can%27t-reference-a-component-(Label)-multiple-times--td21983670.html

--pete



On Fri, Jul 24, 2009 at 3:47 PM, tubin gen <fa...@gmail.com> wrote:

> I created a label and I wabnt to use this label in seeral places in
> page , is it allowed , right now I getting exception
>
>  [Component id = documentType] has the same wicket:id as another
> component already added at the same level
>
> so If want to show the same text  at 5 different places in markup do I
> have to create 5 label objects with the same model ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: use a lable in several palces in a page

Posted by Fernando Wermus <fe...@gmail.com>.
Instead of having one text field with the same text, you can have several
text fields pointed to the same model attribute.

On Fri, Jul 24, 2009 at 2:34 PM, Jeremy Thomerson <jeremy@wickettraining.com
> wrote:

> That comes from the component use checker - which is only enabled by
> default in development.  You can turn it off and use the label
> multiple places in a page, but you must do so at your own risk - if
> you add behaviors and such to it, you will end up breaking things
> (since the components will be given the same HTML ID).
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Jul 24, 2009 at 3:47 PM, tubin gen<fa...@gmail.com> wrote:
> > I created a label and I wabnt to use this label in seeral places in
> > page , is it allowed , right now I getting exception
> >
> >  [Component id = documentType] has the same wicket:id as another
> > component already added at the same level
> >
> > so If want to show the same text  at 5 different places in markup do I
> > have to create 5 label objects with the same model ?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: use a lable in several palces in a page

Posted by Jeremy Thomerson <je...@wickettraining.com>.
That comes from the component use checker - which is only enabled by
default in development.  You can turn it off and use the label
multiple places in a page, but you must do so at your own risk - if
you add behaviors and such to it, you will end up breaking things
(since the components will be given the same HTML ID).

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jul 24, 2009 at 3:47 PM, tubin gen<fa...@gmail.com> wrote:
> I created a label and I wabnt to use this label in seeral places in
> page , is it allowed , right now I getting exception
>
>  [Component id = documentType] has the same wicket:id as another
> component already added at the same level
>
> so If want to show the same text  at 5 different places in markup do I
> have to create 5 label objects with the same model ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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