You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Moore <an...@bigfoot.com> on 2007/08/01 16:14:11 UTC

Simple question about feedback of Required fields

I seem to be having some trouble getting the correct setup to get my own
messages from the RequiredValidator

I have the following simple code:
----------------------------------------
	final TextField nameField = new TextField("name");
	nameField.setRequired(true);
       
nameField.add(StringValidator.maximumLength(100)).add(StringValidator.minimumLength(2));
	final FormComponentFeedbackBorder nameFeedback = new
FormComponentFeedbackBorder("nameFeedback");
	form.add(nameFeedback);
	nameFeedback.add(nameField);	

and the following html:
---------------------------
<form wicket:id="websiteForm" >
<td><input wicket:id="name" type="text" size="50" maxlength="100" /></td>
</form>

In my .properties file thought I would therefore need something like this:
websiteForm.nameFeedback.name.RequiredValidator=A website name must be
specified

but instead of the message in the properties file, I always get:
field 'name' is required.


This code (or very similar) was fine in 1.2, but has something changed in
1.3 (beta2, but it also happened on the incubating snapshots) that means
I've to change this a little
I have tried the following combinations, but none seem to work:
websiteForm.nameFeedback.name.RequiredValidator=A website name must be
specified (-full)
nameFeedback.name.RequiredValidator=A website name must be specified (-form)
name.RequiredValidator=A website name must be specified (-form and feedback)
websiteForm.name.RequiredValidator=A website name must be specified
(-feedback)

I also know that the .properties file is getting picked up, because
my message of: 
name.StringValidator.minimum=The length of the name must be at least
${minimum} characters
gets picked up correctly.

Anyone know what I'm doing wrong.
Cheers
Andrew

-- 
View this message in context: http://www.nabble.com/Simple-question-about-feedback-of-Required-fields-tf4200313.html#a11946340
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Simple question about feedback of Required fields

Posted by Igor Vaynberg <ig...@gmail.com>.
s/RequiredValidatior/Required/

-igor


On 8/1/07, Andrew Moore <an...@bigfoot.com> wrote:
>
>
> I seem to be having some trouble getting the correct setup to get my own
> messages from the RequiredValidator
>
> I have the following simple code:
> ----------------------------------------
>         final TextField nameField = new TextField("name");
>         nameField.setRequired(true);
>
> nameField.add(StringValidator.maximumLength(100)).add(
> StringValidator.minimumLength(2));
>         final FormComponentFeedbackBorder nameFeedback = new
> FormComponentFeedbackBorder("nameFeedback");
>         form.add(nameFeedback);
>         nameFeedback.add(nameField);
>
> and the following html:
> ---------------------------
> <form wicket:id="websiteForm" >
> <td><input wicket:id="name" type="text" size="50" maxlength="100" /></td>
> </form>
>
> In my .properties file thought I would therefore need something like this:
> websiteForm.nameFeedback.name.RequiredValidator=A website name must be
> specified
>
> but instead of the message in the properties file, I always get:
> field 'name' is required.
>
>
> This code (or very similar) was fine in 1.2, but has something changed in
> 1.3 (beta2, but it also happened on the incubating snapshots) that means
> I've to change this a little
> I have tried the following combinations, but none seem to work:
> websiteForm.nameFeedback.name.RequiredValidator=A website name must be
> specified (-full)
> nameFeedback.name.RequiredValidator=A website name must be specified
> (-form)
> name.RequiredValidator=A website name must be specified (-form and
> feedback)
> websiteForm.name.RequiredValidator=A website name must be specified
> (-feedback)
>
> I also know that the .properties file is getting picked up, because
> my message of:
> name.StringValidator.minimum=The length of the name must be at least
> ${minimum} characters
> gets picked up correctly.
>
> Anyone know what I'm doing wrong.
> Cheers
> Andrew
>
> --
> View this message in context:
> http://www.nabble.com/Simple-question-about-feedback-of-Required-fields-tf4200313.html#a11946340
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>