version : Jdeveloper 11g r2
Below is a validator method which belongs to an attribute in a page ,but not working with me
Attribute Type = String
validator = validatorStoreName()
but in case i change the if condition to be like this "if (newValue.length()>0 || newValue!=null ) " it works fine
public void validatorStoreName(FacesContext facesContext, UIComponent uIComponent, Object object) {
FacesContext fc = FacesContext.getCurrentInstance();
String newValue = (String)object;
if (newValue.length()==0 || newValue==null ) {
System.out.println("null 1_____ "+"object= "+object+" newvalue= "+newValue);
FacesMessage message =new FacesMessage(FacesMessage.SEVERITY_ERROR, "Null Value not allowed",null);
fc.addMessage(uIComponent.getClientId(fc), message);
((RichInputText)uIComponent).setValid(false);
}
else {
System.out.println("object= "+object+" newvalue= "+newValue);
}
}
Take in consideration " I'm beginner "
Thanks in advance