# ZK MVVM Validation - Dependent Property Array content?

FlorianSchaetz
31 6

I'm playing around with the ZK 8 MVVM form validation system and generally it seems to do what I want, but I wonder what the definition of the dependent property index is...

Let's take a simple validator...

public class FormValidator extends AbstractValidator {

@Override
public void validate(final ValidationContext ctx) {

Property[] properties = ctx.getProperties("firstName");

Object value0 = properties[0].getValue();
Object value1 = properties[1].getValue();

}
}


So, when this is called before the save command, for every property, I get a Property[] array of length 2. But somehow, I have yet to find out what is stored in [0] and what is stored in [1]. Sometimes it seems that [0] stores the current value (which may or may not be valid according the field validator there) and [1] the last valid entry... But sometimes it seems to be the other way round...

The examples in the documentation always seem to simply take the first element ([0]) for validation, but I would like the understand what both parts of this pair actually mean...

Anyone got an idea for that?

delete retag edit
Be the first one to answer this question!
[hide preview]