}
final NestableNode parent = element.getParent();
final Element inputElement = (Element) element.cloneNode(parent, false);
inputElement.removeAttribute(attributeName);
inputElement.setAttribute("id", id);
inputElement.setAttribute("name", name);
inputElement.setAttribute(
"value",
RequestDataValueProcessorUtils.processFormFieldValue(
arguments.getConfiguration(), arguments, name, value, "checkbox"));
if (checked) {
inputElement.setAttribute("checked", "checked");
} else {
inputElement.removeAttribute("checked");
}
inputElement.setAllNodeLocalVariables(localVariables);
parent.insertBefore(element, inputElement);
if (!isDisabled(inputElement)) {
final String hiddenName = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + name;
final String hiddenValue = "on";
final Element hiddenElement = new Element("input");
hiddenElement.setAttribute("type", "hidden");
hiddenElement.setAttribute("name", hiddenName);
hiddenElement.setAttribute(
"value",
RequestDataValueProcessorUtils.processFormFieldValue(
arguments.getConfiguration(), arguments, hiddenName, hiddenValue, "hidden"));
hiddenElement.setAllNodeLocalVariables(localVariables);
parent.insertBefore(element, hiddenElement);
}