📄 clientandservervalidation.xhtml
字号:
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
xmlns:ajax="http://www.apusic.com/jsf/ajax" renderKitId="AJAX"
xmlns:h="http://java.sun.com/jsf/html" xmlns:om="http://www.apusic.com/jsf/misc">
<w:head>
<w:stylesheet src="/common/resources/examples.css"/>
</w:head>
<w:page>
<div class="examDesc">
<p>本例演示了"客户端和服务器端"同时进行验证,和服务端单独验证所不同的是,仅仅需要在form上面加上clientValidate="true",引擎会自动生成客户端验证的代码,不需要额外的写javascript代码</p>
</div>
<om:useBean value="ServerValidationBean"></om:useBean>
<w:form transient="true" msgTarget="side" clientValidate="true">
<layout:panelGrid columns="1">
<w:textField id="name" fieldLabel="姓名:"></w:textField>
<w:textField id="password" fieldLabel="密码:" inputType="password"></w:textField>
<w:textField id="email" fieldLabel="邮件:"></w:textField>
<w:dateField id="birthday" fieldLabel="生日:"></w:dateField>
<w:numberField id="age" fieldLabel="年龄:"></w:numberField>
<w:button value="提交" id="click" />
<h:outputText id="response"></h:outputText>
</layout:panelGrid>
</w:form>
</w:page>
</f:view>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -