Simple Custom Input Validation: Failover during PROCESS_VALIDATIONS phase


<xp:inputText id="inputText2">
	<xp:this.validator>
		<![CDATA[#{javascript:
			var sv = this.getSubmittedValue();
			if(sv.length > 3){
				var msgStr = "way too long!";
				var msgObj = new javax.faces.application.FacesMessage(
				javax.faces.application.FacesMessage.SEVERITY_ERROR, msgStr, msgStr);
				facesContext.addMessage(getClientId(this.getId()), msgObj);
				this.setValid(false);
			}
		}]]>
	</xp:this.validator>
</xp:inputText>
<xp:message id="message2" for="inputText2"></xp:message>
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...