Specifying different error messages for different composite components

后端 未结 1 1088
傲寒
傲寒 2021-01-15 02:43

Is there a way to have REQUIRED messages for different kinds of composite components?

I\'d like to be able to say something like the following in a message bundle

1条回答
  •  星月不相逢
    2021-01-15 03:13

    Use the requiredMessage attribute to specify them.

    
    

    For the case you didn't knew that, the #{cc.resourceBundleMap} refers the composite component specific resource bundle which is identified by a .properties file with the same filename as the composite component in the same folder.

    So, imagine that you've a composite component file foo.xhtml, then you can specify the localized messages in foo.properties (and consequently foo_en.properties, foo_es.properties, etc) which reside in the very same folder. Those localized messages are then available by the aforementioned #{cc.resourceBundleMap}.

    0 讨论(0)
提交回复
热议问题