Hi Anthony,

I think you want to have the exact keys for the messages used by Myfaces by default.

If you're using myfaces-all.jar, open it with Winrar or Winzip or whatever zipping tool, and go to javax/faces. You will find several properties files. If you open the Messages.properties, you will find keys for all default messages used by JSF:

# standard messages (Spec. 2.5.1.4)

javax.faces.component.UIInput.CONVERSION        = Conversion Error
javax.faces.component.UIInput.CONVERSION_detail = "{0}": Conversion error occurred.

javax.faces.component.UIInput.REQUIRED        = Validation Error
javax.faces.component.UIInput.REQUIRED_detail = "{0}": Value is required.

javax.faces.component.UISelectOne.INVALID        = Validation Error
javax.faces.component.UISelectOne.INVALID_detail = "{0}": Value is not a valid option.

javax.faces.component.UISelectMany.INVALID         = Validation Error
javax.faces.component.UISelectMany.INVALID_detail = "{0}": Value is not a valid option.

javax.faces.validator.NOT_IN_RANGE        = Validation Error
javax.faces.validator.NOT_IN_RANGE_detail = "{2}": Specified attribute is not between the expected values of {0} and {1}.

etc..

So you can just redefine them in your resource bundle ;-)

Regards,
Enrique.

On 3/6/06, Anthony Hong <[EMAIL PROTECTED]> wrote:
If I write this in this way,
<h:inputText id="txtDebtorLimit" size="20"
value="#DebtorController.currentDebtor.limit}"/>
<h:message for="" errorClass="error_message"/>

when error occured, it shows: txtCustomerID Value is required.

But I want to change txtCustomerID to support mulit language, it
should fetch value from resource bundle at first.
Can I do that?  Is that means I have to rewrite all validator in My
Faces implementation?

--

Anthony Hong

Reply via email to