Raul wrote: > Thank Col, But I have no validation, my component code is the code of the > component is > > public class CustomerAccountCode extends > FormComponentPanel<Account> { > > private FormComponent<String> entity; > private FormComponent<String> office; > private FormComponent<String> dc; > private FormComponent<String> number; > > > public CustomerAccountCode(String id, Model<Account> model) { > super(id, model); > > entity = new TextField<String>("entity", new Model<String>()); > office = new TextField<String>("office", new Model<String>()); > dc = new TextField<String>("dc", new Model<String>()); > number = new TextField<String>("number", new Model<String>()); > > onModelChanged(); > add(entity); > add(office); > add(dc); > add(number); > // add(CustomerAccountCodeValidator.getInstance()); > > } > > protected void onModelChanged() { > super.onModelChanged(); > CustomerAccountCodeModel ccc = getModelObject(); > if (ccc != null) { > entity.setModelObject(ccc.getEntity()); > office.setModelObject(ccc.getOffice()); > dc.setModelObject(ccc.getDc()); > number.setModelObject(ccc.getAccount()); > } else { > entity.setModelObject(null); > office.setModelObject(null); > dc.setModelObject(null); > number.setModelObject(null); > } > }
Did you try to use PropertyModels of your account object, maybe a CompoundPropertyModel instead of setting the TextField's model objects in the constructor that way? Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org