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: AW: Any way to customize this validate number message?
Date Wed, 02 Dec 2009 18:23:09 GMT
Btw. the file where are the messages are located is 

myfaces-impl-x.x.x.jar!/javax.faces/MessagesXXX.properties 



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


Hi Rene,

I changed the input ... is this what you meant because I still get the same
error ...

                <label id="Dome Tour, Number of Adults"
for="domeTourNumber_of_Adults">
                  *
                  <strong>Number of Adults:</strong>
                </label>
                <t:inputText forceId="true" 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" />
               </t:inputText>

The error that appears is 

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

Any ideas what I might be doing wrong?  Thanks, - Dave



Rene Guenther wrote:
> 
> 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.
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Any-way-to-customize-this-validate-number-message--tp26612567p26613605.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message