Not tested, but this is the way it should work (more or less...)
public class MyBean {
String question;
String answer;
// plus Getters and Setters...
}
public class Test extends WebPage {
public Test() {
add( new TestForm( "TestForm" ) );
}
@SuppressWarnings("serial")
public final class TestForm extends Form<MyBean> {
public TestForm( final String id ) {
super(id);
final ArrayList<MyBean> list = new ArrayList<MyBean>();
list.add(new MyBean("Frage 1");
list.add(new MyBean("Frage 2");
add( new ListView<MyBean>( "ListFragen", list ) {
protected void populateItem(ListItem<MyBean> item) {
item.add(new Label("Frage", new PropertyModel(item.getModel(),
"question"));
item.add(new Input_Panel("Input", new PropertyModel(item.getModel(),
"answer")));
}
});
public final void onSubmit() {
for (MyBean bean : list) {
log.debug(bean); // See what the user entered
}
}
}
}
}
-----
--
Regards,
Hans
http://www.cantaa.de http://cantaa.de
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3318961.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]