Discussion

4
Replies
3533
Views
Roman Petrov (RomanP04)
I-Teco

I-Teco
RU
RomanP04 Member since 2015 5 posts
I-Teco
Posted: November 20, 2015
Last activity: November 22, 2015
Posted: 20 Nov 2015 15:39 EST
Last activity: 22 Nov 2015 15:11 EST
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 Experience
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion.