Hi Steen,

I use a similar approach, having the 'master' form in an abstract base page,
and adding multiple panels on a concrete subpage, of which only one is
visible at a time. The submit buttons is added directly under the form.
The abstract basepage contains this:

    public WizardPage(PageParameters params, IWizard aWizard) {
        super(params, aWizard.getModel());
        this.wizard = aWizard;
        Form form = new Form("questionform", new
CompoundPropertyModel(getModel()))
        {
            protected void onSubmit() {
                // TODO
            }
        };
        form.add(new Label("wizardName", new PropertyModel(this,
"wizardName")));
        Component[] comps = wizard.getComponents();
        for (int i=0; i<comps.length; i++) {
            Component c = comps[i];
            c.setOutputMarkupPlaceholderTag(true);
            if (wizard.getActiveComponentIndex() == i) {
                c.setVisible(true);
            }
            else {
                c.setVisible(false);
            }
            form.add(c);
        }
        form.add(new WizardNavigator("wizardNavigator", wizard));
        add(form);
    }

As you can see, the wizard contains the model, but also the panels for each
step in the wizard. One of the components is this panel (sorry for te Dutch
names)

public class InvoerenStartdatumPanel extends Panel {

    public InvoerenStartdatumPanel(String id, IModel model) {
        super(id, model);
        DatePicker dp = new DatePicker() {
            protected boolean enableMonthYearSelection() {
                return true;
            }
        };

        DateTextField df = new DateTextField("startDatum", new
PropertyModel(getModelObject(), "startDatumBedrijfsuitoefening"), new
StyleDateConverter("S-", true));
        df.setRequired(true);
        df.add(dp);
        add(df);
        add(new FeedbackPanel("feedback", new
ComponentFeedbackMessageFilter(df)));
    }
}

2008/1/9, Steen Larsen <[EMAIL PROTECTED]>:
>
> I have a form with a RadioGroup containing a ListView much like the
> example
> from WicketStuff, which works fine.
>
> Now I would like to get the radiogroup part out into a panel that I could
> then add to the form multiple times with different models (products),
> however I can't figure out where the chosen radiobuttons backing model
> gets
> set as it isn't on the model object I used. Anyone got  an example of
> submitting a form containing panels (tat is panels not containing forms
> themselves)?
>
> In the normal case the resulting object gets set on the property specified
> in the radiogroup, and I suspect the problem has something to do with the
> added markup identifier from adding a panel to the form instead of the
> radiogroup but haven't been able to figure it out.
>
> /Steen
>



-- 
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29

Reply via email to