I have found you can add a new row, but if you try modifying an existing row, the changes don't seem to take effect. I'm posting my code below to be reviewed.
.tml <t:Zone t:id="formZone"> <t:form t:id="admin" zone="formZone"> Current State <t:ActionLink t:id="test" t:zone="testZone">test</t:ActionLink> <t:Zone t:id="testZone" id="testZone" visible="false"> <div t:type="ajaxformloop" t:id="formValidations" source="formValidations" value="formValidation" encoder="encoder"> <t:select t:id="currentState" value="formValidation.currentState" model="stateModel" blankLabel="Select Current State"/> <t:removerowlink>remove</t:removerowlink> </div> </t:Zone> <t:Submit value="Update"/> </t:form> </t:Zone> .class @Property private FormValidation formValidation; @Property @Persist private List<FormValidation> formValidations; @Inject private Session session; @Property @Persist private SelectModel stateModel; @Inject private SelectModelFactory selectModelFactory; @InjectComponent private Zone testZone, formZone; Object onActionFromTest() { return testZone.getBody(); } void onPrepareForRender() { formValidations = session.createCriteria(FormValidation.class).list(); List<PrState> prStates = session.createCriteria(PrState.class).list(); stateModel = selectModelFactory.create(prStates, "Label"); } @CommitAfter Object onSuccess() { for(FormValidation _formValidation : formValidations) { session.saveOrUpdate(_formValidation); } return formZone.getBody(); } Object onAddRow() { formValidation = new FormValidation(); formValidations.add(formValidation); return formValidation; } public ValueEncoder<FormValidation> getEncoder() { return new ValueEncoder<FormValidation>() { public String toClient(FormValidation formValidation) { return String.valueOf(formValidation.getTempId()); } public FormValidation toValue(String clientValue) { Long key = new Long(clientValue); for (FormValidation holder : formValidations) { if (holder.getTempId() == key) { return holder; } } return null; } }; } @CommitAfter void onRemoveRow(FormValidation formValidation) { formValidations.remove(formValidation); session.delete(formValidation); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-Bug-AjaxFormLoop-nested-within-Zone-tp5029977p5032526.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org