开发者

How to pass parameters to a validator of a rich:inplaceInput component

开发者 https://www.devze.com 2022-12-28 14:04 出处:网络
I\'ve seen BalusC\'s page on passing values to a validator but that is using inputText components.I\'m using rich:inplaceInput components and it doesn\'t se开发者_C百科em to work.Can someone tell me i

I've seen BalusC's page on passing values to a validator but that is using inputText components. I'm using rich:inplaceInput components and it doesn't se开发者_C百科em to work. Can someone tell me if it is possible, and if it is how to do simply?

Thanks


For sure you can add validators to rich:inplaceEdit. Here is an example:

<rich:inplaceEdit required="true" value="#{myBean.name}">
  <f:validateLength minimum="3" maximum="25" />
</rich:inplaceEdit>

This validates that the field is filled in (required="true") and that the entered text has a length between 3 and 25 characters ().

If you don't see any error message make sure you have a message component that displays your error message and that is properly updated.

0

精彩评论

暂无评论...
验证码 换一张
取 消