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