Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Cannot Reproduce
-
5.4
Description
On 5.4-beta-26.
Given a template like this :
<t:form t:id="form"> <t:errors/> <t:loop source="items" value="item"> <div> <t:label for="field"/> <t:textfield t:id="field" value="value" label="prop:item"/> </div> </t:loop> <div> <t:submit/> </div> </t:form>
If the validation of the form fails (global validation), the page is displayed with all the field containing the same value, the last one.
Index.java
public class Index { private Map<String, String> values; @Property private String item; public String[] getItems() { return new String[]{"one", "two", "three"}; } public void setValue(String value) { if (values == null) { values = new LinkedHashMap<>(); } values.put(item, value); } public String getValue() { if (values == null) { values = new LinkedHashMap<>(); for (String item : getItems()) { values.put(item, item); } } return values.get(item); } @Inject private AlertManager alertManager; @InjectComponent private Form form; public void onValidateFromForm() { form.recordError("Purposely generated error"); } public void onSuccessFromForm() { for (Map.Entry<String, String> entry : values.entrySet()) { alertManager.info(entry.getKey() + " = " + entry.getValue()); } } }
Any help will be welcomed to guide me to provide a patch.
Attachments
Attachments
Issue Links
- duplicates
-
TAP5-2391 Field-specific error not shown when AJAX used
- Reopened