You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jered Myers <je...@maplewoodsoftware.com> on 2011/08/12 22:05:17 UTC
Label tag wicket:for question
I am using a label tag with wicket:for (Wicket 1.4.18) and the text of
the label is not replacing as I expect.
I am using a label tag in my HTML like so:
<label wicket:for="firstName">
<span class="label-text">Name</span>
</label>
<input type="text" wicket:id="firstName" />
In my Java code:
RequiredTextField<?> firstName = new RequiredTextField<String>("firstName")
firstName.setOutputMarkupId(true));
firstName.setLabel(new Model<String>("Yo!"); // TODO This should come
from a properties file
add(firstName);
When the page renders, the text for the label tag is "Name" and I expect
it to be "Yo!". The error message works and shows "Field 'Yo!' is
required". Am I understanding the use of the label tag correctly?
Jered
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Label tag wicket:for question
Posted by Jered Myers <je...@maplewoodsoftware.com>.
Thanks that worked perfectly!
On 08/12/2011 01:28 PM, Igor Vaynberg wrote:
> this has been changed in later commits, use
> <wicket:label>Name</wicket:label> instead of<span class="label-text">
>
> -igor
>
>
> On Fri, Aug 12, 2011 at 1:05 PM, Jered Myers
> <je...@maplewoodsoftware.com> wrote:
>> I am using a label tag with wicket:for (Wicket 1.4.18) and the text of the
>> label is not replacing as I expect.
>>
>> I am using a label tag in my HTML like so:
>>
>> <label wicket:for="firstName">
>> <span class="label-text">Name</span>
>> </label>
>> <input type="text" wicket:id="firstName" />
>>
>>
>> In my Java code:
>>
>> RequiredTextField<?> firstName = new RequiredTextField<String>("firstName")
>> firstName.setOutputMarkupId(true));
>> firstName.setLabel(new Model<String>("Yo!"); // TODO This should come from a
>> properties file
>> add(firstName);
>>
>> When the page renders, the text for the label tag is "Name" and I expect it
>> to be "Yo!". The error message works and shows "Field 'Yo!' is required".
>> Am I understanding the use of the label tag correctly?
>>
>> Jered
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Label tag wicket:for question
Posted by Igor Vaynberg <ig...@gmail.com>.
this has been changed in later commits, use
<wicket:label>Name</wicket:label> instead of <span class="label-text">
-igor
On Fri, Aug 12, 2011 at 1:05 PM, Jered Myers
<je...@maplewoodsoftware.com> wrote:
> I am using a label tag with wicket:for (Wicket 1.4.18) and the text of the
> label is not replacing as I expect.
>
> I am using a label tag in my HTML like so:
>
> <label wicket:for="firstName">
> <span class="label-text">Name</span>
> </label>
> <input type="text" wicket:id="firstName" />
>
>
> In my Java code:
>
> RequiredTextField<?> firstName = new RequiredTextField<String>("firstName")
> firstName.setOutputMarkupId(true));
> firstName.setLabel(new Model<String>("Yo!"); // TODO This should come from a
> properties file
> add(firstName);
>
> When the page renders, the text for the label tag is "Name" and I expect it
> to be "Yo!". The error message works and shows "Field 'Yo!' is required".
> Am I understanding the use of the label tag correctly?
>
> Jered
>
>
>
>
> ---------------------------------------------------------------------
> 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