Add div around extra hidden fields in FormTag
Issue: SPR-10926
This commit is contained in:
@@ -493,11 +493,13 @@ public class FormTag extends AbstractHtmlElementTag {
|
|||||||
*/
|
*/
|
||||||
private void writeHiddenFields(Map<String, String> hiddenFields) throws JspException {
|
private void writeHiddenFields(Map<String, String> hiddenFields) throws JspException {
|
||||||
if (hiddenFields != null) {
|
if (hiddenFields != null) {
|
||||||
|
this.tagWriter.appendValue("<div>\n");
|
||||||
for (String name : hiddenFields.keySet()) {
|
for (String name : hiddenFields.keySet()) {
|
||||||
this.tagWriter.appendValue("<input type=\"hidden\" ");
|
this.tagWriter.appendValue("<input type=\"hidden\" ");
|
||||||
this.tagWriter.appendValue("name=\"" + name + "\" value=\"" + hiddenFields.get(name) + "\" ");
|
this.tagWriter.appendValue("name=\"" + name + "\" value=\"" + hiddenFields.get(name) + "\" ");
|
||||||
this.tagWriter.appendValue("/>\n");
|
this.tagWriter.appendValue("/>\n");
|
||||||
}
|
}
|
||||||
|
this.tagWriter.appendValue("</div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ public class FormTagTests extends AbstractHtmlElementTagTests {
|
|||||||
|
|
||||||
String output = getOutput();
|
String output = getOutput();
|
||||||
|
|
||||||
assertEquals("<input type=\"hidden\" name=\"key\" value=\"value\" />", getInputTag(output));
|
assertEquals("<div>\n<input type=\"hidden\" name=\"key\" value=\"value\" />\n</div>", getInputTag(output));
|
||||||
assertFormTagOpened(output);
|
assertFormTagOpened(output);
|
||||||
assertFormTagClosed(output);
|
assertFormTagClosed(output);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user