try formborder extends border { formborder() { form.add(getbodycontainer(); } }
if that doesnt help you might have to say formborder.getbodycontainer().add(textfield); but i think the first tweak should fix it -igor On Fri, Apr 11, 2008 at 11:54 AM, John Krasnay <[EMAIL PROTECTED]> wrote: > Hi all. I'm trying to create a component I call a FormBorder. The idea > is to embed the form and OK/Cancel buttons into the border: > > <wicket:border> > <div class="form"> > <form wicket:id="form"> > <wicket:body/> > <div class="buttons"> > <input wicket:id="button" type="submit"/> > </div> > </form> > </div> > </wicket:border> > > public FormBorder(String id, IModel model) { > super(id, model); > add(form = new Form("form")); > form.add(getBodyContainer()); > form.add(buttons = new RepeatingView("button")); > // ... add buttons to the repeating view > } > > I'd like to use it like this... > > FormBorder border = new FormBorder("border"); > border.add(new TextField("name", new PropertyModel(person, "name"))); > > ...but it doesn't work quite right. The page renders fine, but upon > submit the data never makes it back into the TextField's model. > Presumably this is because the TextField is a child of the border, not > of the form. > > Is there any way to make this work, other than taking the form > completely out of the border? > > jk > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]