You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wenm <wm...@tdc.dk> on 2008/06/13 13:07:33 UTC
validation message
I try to validate component by using setRequired(). and I would like to
define the feedback messages in application level properties file.
For example, the application structure is like
myApplication
-basePage
-myPage extends basePage
-myForm
-myTextField
I tried to overwrite the default message in myApplication.properties like:
myPage.myForm.myTextField.Required = something is missing
But it is not succeful.
I don't know whether I do something wrong or I have to set up something in
myApplication?
Thanks.
--
View this message in context: http://www.nabble.com/validation-message-tp17821088p17821088.html
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: validation message
Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Mon, 16 Jun 2008, wenm wrote:
> Maybe I didn't explain clearly. I knew how to override in myPage.properties
> and myForm.properties. But I mean if I want to override in
> myApplication.properties, is it possible to do and how's the hierarchies?
I have found it easiest to just debug which keys the
component is trying. Though I believe that a more a priori
solution is on the wiki :)
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: validation message
Posted by wenm <wm...@tdc.dk>.
Thanks for reply.
Maybe I didn't explain clearly. I knew how to override in myPage.properties
and myForm.properties. But I mean if I want to override in
myApplication.properties, is it possible to do and how's the hierarchies?
richardwilko wrote:
>
>
> If yo have a Required validator on a TextField with
> wicket:id="mytextfield" in a form with wicket:id="myform" in a Page called
> MyPage.java in a package called com.mypackage then
>
> create a file called MyPage.properties in the package com.mypackage
>
> in this properties file is where you override the validation messages for
> anything in the page, so in this example you would add the line
>
> myform.mytextfield.Required=My required message
>
> see how the hierarchies match and the Required is the same name as your
> validator class (so if you used an EmailAddressValidator you would put
> myform.mytextfield.EmailAddressValidator)
>
> If your form was in its own java file called MyForm.java then you would
> put the properties file in the same package as MyForm.java and you would
> call your properties file MyForm.properties
>
> and it would look like this
>
> mytextfield.Required=My required message
>
> note how you dont need the myform. bit.
>
> Also see this page:
> http://cwiki.apache.org/WICKET/form-validation-messages.html
>
> Hope that explains it
>
> Richard
>
>
> wenm wrote:
>>
>> I try to validate component by using setRequired(). and I would like to
>> define the feedback messages in application level properties file.
>>
>> For example, the application structure is like
>> myApplication
>> -basePage
>> -myPage extends basePage
>> -myForm
>> -myTextField
>>
>> I tried to overwrite the default message in myApplication.properties
>> like:
>> myPage.myForm.myTextField.Required = something is missing
>> But it is not succeful.
>>
>> I don't know whether I do something wrong or I have to set up something
>> in myApplication?
>> Thanks.
>>
>
>
--
View this message in context: http://www.nabble.com/validation-message-tp17821088p17858907.html
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: validation message
Posted by richardwilko <ri...@gmail.com>.
If yo have a Required validator on a TextField with wicket:id="mytextfield"
in a form with wicket:id="myform" in a Page called MyPage.java in a package
called com.mypackage then
create a file called MyPage.properties in the package com.mypackage
in this properties file is where you override the validation messages for
anything in the page, so in this example you would add the line
myform.mytextfield.Required=My required message
see how the hierarchies match and the Required is the same name as your
validator class (so if you used an EmailAddressValidator you would put
myform.mytextfield.EmailAddressValidator)
If your form was in its own java file called MyForm.java then you would put
the properties file in the same package as MyForm.java and you would call
your properties file MyForm.properties
and it would look like this
mytextfield.Required=My required message
note how you dont need the myform. bit.
Also see this page:
http://cwiki.apache.org/WICKET/form-validation-messages.html
Hope that explains it
Richard
wenm wrote:
>
> I try to validate component by using setRequired(). and I would like to
> define the feedback messages in application level properties file.
>
> For example, the application structure is like
> myApplication
> -basePage
> -myPage extends basePage
> -myForm
> -myTextField
>
> I tried to overwrite the default message in myApplication.properties like:
> myPage.myForm.myTextField.Required = something is missing
> But it is not succeful.
>
> I don't know whether I do something wrong or I have to set up something in
> myApplication?
> Thanks.
>
--
View this message in context: http://www.nabble.com/validation-message-tp17821088p17825892.html
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