Comments on: How to create a custom JSF Validator – The Greater Than Validator to enforce one component's value being larger than some other's https://technology.amis.nl/2006/12/28/how-to-create-a-custom-jsf-validator-the-greater-than-validator-to-enforce-one-components-value-being-larger-than-some-others/ Friends of Oracle and Java Thu, 21 May 2015 20:49:51 +0000 hourly 1 http://wordpress.org/?v=4.2.2 By: Jeff Luo https://technology.amis.nl/2006/12/28/how-to-create-a-custom-jsf-validator-the-greater-than-validator-to-enforce-one-components-value-being-larger-than-some-others/#comment-4202 Tue, 30 Jan 2007 20:27:45 +0000 http://technology.amis.nl/blog/?p=1456#comment-4202 The validator needs to implement StateHolder. See javax.faces.validator.DoubleRangeValidator for implementation details.

]]>
By: Ravi https://technology.amis.nl/2006/12/28/how-to-create-a-custom-jsf-validator-the-greater-than-validator-to-enforce-one-components-value-being-larger-than-some-others/#comment-4201 Mon, 22 Jan 2007 12:49:06 +0000 http://technology.amis.nl/blog/?p=1456#comment-4201 Hi Lucas,
Thanks for the reply and i had checked the application for the items u have specified ,din’t find any thing missing out there by me
In GreaterThanValidatorTag which extends ValidatorTag
public void setGreaterThanId(String greaterThanId) {
this.greaterThanId = greaterThanId;
}

public String getGreaterThanId() {
return greaterThanId;
}
public void release() {
greaterThanId = null;
}
for setting greaterThanId

In MyTag.tld

Validator – Enforce that Component’s value is GreaterThan other Component’s Value
greaterThan
greaterThan
view.frameworkExt.jsf.tags.GreaterThanValidatorTag

greaterThanId

empty
Brief snippet showing how to use this tag.

and in Jsf Jsp page only

where form is provided with id “form1″

please comment any thing need to be configured more to use this Custom Validations effectively

]]>
By: Lucas Jellema https://technology.amis.nl/2006/12/28/how-to-create-a-custom-jsf-validator-the-greater-than-validator-to-enforce-one-components-value-being-larger-than-some-others/#comment-4200 Sat, 13 Jan 2007 10:39:15 +0000 http://technology.amis.nl/blog/?p=1456#comment-4200 Hi Ravi,

My first hunch would be that in the GreaterThanValidatorTag class you have not implemented the setter method in the correct way. However, perhaps even more likely is that you have not defined the attribute greaterThanId to the Tag Library Description.

Did you specify the value of the greaterThanId correctly in the JSP JSF page? You are not by any chance using the validator in a table component ?

Lucas

]]>
By: Ravi https://technology.amis.nl/2006/12/28/how-to-create-a-custom-jsf-validator-the-greater-than-validator-to-enforce-one-components-value-being-larger-than-some-others/#comment-4199 Fri, 12 Jan 2007 12:51:49 +0000 http://technology.amis.nl/blog/?p=1456#comment-4199 I had incorparated this Validation in my application , but only Client side validation is working fine and if correct(valid) values are provided then it is Throwing Null pointer Exception at the line jsf.validator.GreaterThanValidator.validate(GreaterThanValidator.java:25) ie at
UIComponent greaterThanComponent =
uiComponent.findComponent(greaterThanId);

on debuging the code i found that “greaterThanId” is passed as null in the GreaterThanValidator class Object
need to know any mistake done by me as i tested the sample application too which is working fine

any help please

thanks in advance.
Ravi

]]>