myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "G√ľnther, Rene - Innflow AG" <rene.guent...@innflow.com>
Subject AW: Any way to customize this validate number message?
Date Wed, 02 Dec 2009 17:48:30 GMT
Hi Dave,

If I remember correctly, if you use a label and use t:inputText instead of
h:inputText together with forceId="true" in the message
tourType:domeTourNumber_of_Adults: will be replaced with the name of the
label.

There is also a key relating to MyFaces applicationResources.properties file
which contains the message. If you find the key you could use that key along
with your customized message into your applicationResources file which takes
precedence over MyFaces one. You might find the message key eg. by looking
up the file in the MyFaces sources.

If you need different parameters than the default one you'd probably have to
write your own validator.

Cheers
Rene

-----Urspr√ľngliche Nachricht-----
Von: laredotornado [mailto:laredotornado@gmail.com] 
Gesendet: Mittwoch, 2. Dezember 2009 18:10
An: users@myfaces.apache.org
Betreff: Any way to customize this validate number message?


Hi,

I'm using MyFaces 1.1.6.  I have this ...

                <h:inputText id="domeTourNumber_of_Adults"
value="#{domeTour.numAdults}"
                                            required="false"
                                            size="60"
                                            maxlength="60"
                                            styleClass="textFields
numAdultsField">
                <f:validator validatorId="TourRequiredIfCheckedValidator" />

               	<f:validator validatorId="TourTotalPeopleValidator" />
               	<f:validator validatorId="TourAdultChildRatioValidator" />
               </h:inputText>

in which the bean's set and get type is an int.  So if I enter a value like
"aaa" into the field, I get a message like

tourType:domeTourNumber_of_Adults: 'aaa' must be a number between
-2147483648 and 2147483647 Example: 9346

I would like to customize this message.  Anyone know how I can do that? 
Thanks, - Dave
-- 
View this message in context:
http://old.nabble.com/Any-way-to-customize-this-validate-number-message--tp2
6612567p26612567.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message