// set up necessary objects to emulate a form submission
RequestCycle cycle = tester.createRequestCycle();
// this could have been any page it seems. see comment at method
MockPage page = new MockPage();
// create component hierarchy
final Form form = new Form("form", new CompoundPropertyModel(modelObject))
{
private static final long serialVersionUID = 1L;
public String getMarkupId()
{
// hack for the fact that this test doesn't relate to any markup
return "foo";
}
};
final RadioGroup group = new RadioGroup("prop1");
final WebMarkupContainer container = new WebMarkupContainer("container");
final Radio choice1 = new Radio("radio1", new Model(radio1));
final Radio choice2 = new Radio("prop2");
final RadioGroup group2 = new RadioGroup("group2", model);
final Radio choice3 = new Radio("radio3", new Model(radio1));
page.add(form);
form.add(group);
group.add(container);
container.add(choice1);
group.add(choice2);
form.add(group2);