Validate Date in PageList
I wrote edit validation rule to check input value(Date) in Pagelist. When i input date that already exists on PageList and click submit button my validation passed. How can i stop perform action when i have invalid value?
Code:
boolean retValue = true;
ClipboardPage pyWorkPage = tools.findPage("tmpTest");
ClipboardProperty pxResults = pyWorkPage.getProperty(".pxResults");
ClipboardProperty CurrentPage = theProperty.getParentProperty();
int currentPageIndex = CurrentPage.indexOf();
java.util.Iterator it = pxResults.iterator();
while (it.hasNext()) {
ClipboardProperty next = (ClipboardProperty) it.next();
int loopPageIndex = next.indexOf();
ClipboardPage nextPage = next.getPageValue();
ClipboardProperty prop = nextPage.getIfPresent(".StartDate");
if (prop != null)
{
if (currentPageIndex != loopPageIndex && prop.getStringValue().equals(theValue)) {
retValue = false;
theProperty.addMessage("Дата уже выбрана для другого АУ");
break;
}
}
}
return retValue;
Can you help or tell a best function to do same check?
Thanks.