hi am geting two same error when validation,i what to display only one error message
am in jdeveloper 11.1.1.6.0,am geting duplicate validation error message
this is how am doing validation
<af:inputText value="#{bindings.Organisationname.inputValue}"
simple="true"
columns="20"
maximumLength="#{bindings.Organisationname.hints.precision}"
shortDesc="#{bindings.Organisationname.hints.tooltip}"
id="it1" autoSubmit="true" required="true"
validator="#{pageFlowScope.orgvalidation.chkOrgName}"
label="Organisation Name">
<f:validator binding="#{bindings.Organisationname.validator}"/>
</af:inputText>
|
public String checkName(String orgname){ |
|
ResultSet rs; |
|
Row curPerson; |
|
String value= null; |
|
OrgAppModuleImpl am =(OrgAppModuleImpl)ADFUtils.getApplicationModuleForDataControl("OrgAppModuleDataControl"); |
|
try { |
|
System.out.println("valueadded "+orgname.toUpperCase()); |
|
value =am.findbyOrgname(orgname.toUpperCase().trim()); |
|
System.out.println("valueadded "+value); |
|
|
|
} |
|
|
catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
} |
|
return value; |
|
}
|
public void chkOrgName(FacesContext facesContext, UIComponent uIComponent, |
|
Object object) { |
|
// Add event code here... |
|
String value =(String)object; |
|
String evalue= checkName(value); |
|
if( evalue == null){ |
|
|
|
}else{ |
|
FacesMessage message = new FacesMessage(); |
|
message.setSeverity(FacesMessage.SEVERITY_ERROR); |
|
message.setSummary("Organisation Name already exists."); |
|
FacesContext context = FacesContext.getCurrentInstance(); |
|
context.addMessage("esecurity", message); |
|
throw new ValidatorException(message); |
|
} |
|