Discussion

4
Replies
3500
Views
RomanP04 Member since 2015 5 posts
I-Teco
Posted: November 20, 2015
Last activity: November 22, 2015
Closed

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.

User Interface
Moderation Team has archived post
Share this page LinkedIn