Hi, im currently having some issues with a CompoundPropertyModel and HiddenField. I'm trying to relate the property of the model with the hidden input field value. I'm not sure if this actually make sense (probably doesn't), anyway the problem I'm facing is the model is not getting updated with the input value. So I'm wondering if what im trying to do it actually make sense and if it is possible. I'll add some instance code.
PD: Wicket is love!. Thank you, Sergio Arellano. Instanse code used: //the bean of the model class SomeClass{ String attr1; Int attr2; // more code } //the form (it is used inside a wicket:panel component) SomeClass someClassObj = new SomeClass(); private Form< SomeClass > newSomeClassForm() { CompoundPropertyModel< SomeClass > someClassModel = new CompoundPropertyModel< SomeClass >(someClassObj); Form< SomeClass > someClassForm = new Form< SomeClass >(" someClassForm ", someClassModel); //here the other bean attrributes someClassForm.add(newSaveButton()); HiddenField attr1 = new HiddenField("attr1"); someClassForm.add(attr1); return someClassForm; } private AjaxButton newSaveButton() { return new AjaxButton("btnSave ") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { //here im getting null value for the input property System.out.println("attr1: " + someClassObj.attr1); } }; } //the html <form wicket:id=" someClassForm "> <label wicket:id="lblSomeLabel">[some label text]</label> <input wicket:id="btnSave" type="button" value="save"></input> <input wicket:id=" attr1" type="hidden" value="1555"></input> </form> ::DISCLAIMER:: ---------------------------------------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects. ----------------------------------------------------------------------------------------------------------------------------------------------------