Hi,

I think you need to override FormComponentPanel#convertInput().

Cheers,
Tobias
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



--
Tobias Gierke
Development

VOIPFUTURE GmbH   Wendenstraße 4   20097 Hamburg,  Germany
Phone +49 40 688 900 111 Mobile +49 172 323 06 11 Fax +49 40 688 900 199
Email jan.bast...@voipfuture.com   Web http://www.voipfuture.com
CEO Jan Bastian
        
Commercial Court AG Hamburg   HRB 109896, VAT ID DE263738086



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

Reply via email to