hi,

i´ve written a validation, which validates some
inputs of a TextField.

Trying to make an added AjaxCoomponentUpdating-
Behaviour updating the component failed in the
way, that the component is only updated by ajax
after clicking the submit-button.

I didn´t find any hints why ajax is waiting for
clicking the button once?

I hope some of your hints will help me.

regards

Henning

_______________ _________________
´ -- Code -- .

public class RegistrationForm extends Form {

ValueMap properties = new ValueMap();

private String usernameValid = "";

//Construct
public RegistrationForm(String id) {
super(id);

final UserValid uv = new UserValid(); //the model

final Label usernameValidation= new Label("username_validation",
new PropertyModel(this, usernameValid));

// username
final TextField username = new TextField("username_",
new PropertyModel(properties, "username"));
username.setRequired(true);
username.add(StringValidator.minimumLength(4));
username.add(new AjaxFormComponentUpdatingBehavior("onblur") {

@Override
protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(feedback);
if (!username.isValid()) {
usernameValid = "Username invalid";
} else {
usernameValid = "";
}
target.addComponent(usernameValidation);

}
});
add(username);
add(usernameValidation);
}

}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to