If I just try to get the value from the field, I see that the value is null.
textInput = new TextField<Integer>( "textInput", new
IModel<Integer>() {
@Override
public void detach() {
// TODO Auto-generated method stub
}
@Override
public Integer getObject() {
return days;
}
@Override
public void setObject( Integer object ) {
value = object.intValue(); // 'object' is null, causes NPE
}
}, Integer.class );
input.add( new IValidator<Integer>() {
private static final long serialVersionUID = 1L;
@Override
public void validate( IValidatable<Integer> validatable ) {
if ( !isValidNumber( validatable.getValue() ) ) {
validatable.error( new ValidationError( "The input is
not valid" ) );
}
}
} );
I think this is what I really don't understand. Why is the value of my text
field null if the form is submitted with an AjaxButton? I think with a
regular Button it was okay. Now the code never goes to the validator.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Form-not-displaying-messages-correctly-tp4658351p4658370.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]