Thanks for the reply, I tried to use the component on the form with the
object
CompoundPropertyModel. As follows,

ccc = new CustomerAccountCode("ccc", 
new CompoundPropertyModel<Account>(new Account(config.getCcc())));
form.add(ccc);
                
But this does the same as before, ie load correctly displayed data, but when
you throw the "onSubmit" form, the model
the "ccc.getModelObject()" still returns null. 

//New implementation    
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, CompoundPropertyModel<Account> 
model)
{
                super(id, model);
                                
                entity = new TextField<String>("entity");
                office = new TextField<String>("office");
                dc = new TextField<String>("dc");
                number = new TextField<String>("number");
                
                AttributeModifier attEntity = new AttributeModifier("name", 
"entity");
                AttributeModifier attOffice = new AttributeModifier("name", 
"office");
                AttributeModifier attDc = new AttributeModifier("name", "dc");
                AttributeModifier attNumber = new AttributeModifier("name", 
"number");
                add(entity.add(attEntity));
                add(office.add(attOffice));
                add(dc.add(attDc));
                add(number.add(attNumber));
//              add(CustomerAccountCodeValidator.getInstance());

        }

        @Override
        public Component add(final Behavior... behaviors) {
                entity.add(behaviors);
                office.add(behaviors);
                dc.add(behaviors);
                number.add(behaviors);
                return this;
        }
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Model-is-null-after-submit-using-FormComponentPanel-tp4654441p4654545.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to