You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2009/04/21 17:24:07 UTC
palette + wizard + validation not empty + a particular item
Hi all,
I need to validate a palette which is in a wizardStep. The validation
consists of being not empty either of having a spec item. The model has the
selected item at the begining. I got an Nullpointer exception when I add the
onchange behavior. The idea is to keep up to date the palette, otherwise I
wouldn't see any changes in the palette. What's wrong?
(MyWizard.java)
...
step.add(new IFormValidator(){
private static final long serialVersionUID =
8174199867825424322L;
public FormComponent[] getDependentFormComponents() {
return null;
}
public void validate(Form form) {
if (modelo.getCandidatos().isEmpty() ||
!modelo.getCandidatos().contains(SesionMisPartidos.getUsuario())){
form.error("debe seleccionar mas de un candidato y debes
estar en la lista");
}
}});
stepCandidatos.getPalette().getRecorderComponent().add(new
AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
}});
I got a nullpointer exception in
stepCandidatos.getPalette().getRecorderComponent().add(new
AjaxFormComponentUpdatingBehavior("onchange") {
I am working with wicket 1.3.0
--
Fernando Wermus.
www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/