if (charData != null) {
value = charData;
}
// Retrieve this element's parent from the stack (should only be
// permitted as a child of a submit element).
XDIMEElementInternal element = context.getCurrentElement();
if (element instanceof XFSubmitElementImpl) {
// If an action field is tagged to indicate that its query
// parameters should contain an extra name value pair (used to
// indicate things like which of two submit buttons was pressed to
// trigger the submission) then HTMLActionFieldHandler appends this
// name value pair using the name and initial value specified in
// the field descriptor of the submit element. In order for our
// parent submit element to set this flag, we should set the
// initial value to the value specified.
XFActionAttributes parentAttributes = ((XFActionAttributes)
((XFSubmitElementImpl)element).getProtocolAttributes());
parentAttributes.setName(name);
parentAttributes.setInitial(value);
parentAttributes.setValue(value);
FieldDescriptor fd = parentAttributes.getFieldDescriptor();
fd.setName(name);
fd.setInitialValue(value);
} else {
String localizedException = EXCEPTION_LOCALIZER.format(
"xforms-invalid-setvalue-parent",
element.getElementType().getLocalName());
LOGGER.error(localizedException);
throw new XDIMEException(localizedException);
}
}