【发布时间】:2014-11-07 17:48:50
【问题描述】:
如何让 inputText 接受除允许空格和特殊字符之外的任何字母?
我试过这样,但不工作......
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/private/commonHomeTemplate.xhtml">
<ui:define name="content">
<h:form id="someForm">
<p:growl id="msg" showDetail="true" life="3000" autoUpdate="true"/>
<p:panelGrid style="100%">
<p:row>
<p:column style="350px">title</p:column>
<p:column>
<h:inputText value="#{someBean.somePropertie}" >
<f:validateRegex pattern="[a-zA-Z]+"/>
</h:inputText>
</p:column>
</p:row>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>
谢谢
【问题讨论】:
-
抱歉,您希望您的 inputText 接受 a-z 和 A-Z 中的字母,但不接受空格和特殊字符吗?哪些特殊字符是你不想接受的?
-
谢谢我不会用波浪线等重音... #$%&/()=" 所有这些...
标签: jsf primefaces