* @param attributes The attributes to use when generating the mark up.
*/
public void doActionInput(DOMOutputBuffer dom,
XFActionAttributes attributes) {
XFFormAttributes formAttributes = attributes.getFormAttributes();
// if this action is being rendered in a form, then only the first
// action should do anything in VoiceXML, the rest are ignored.
if (formAttributes != null) {
if (formAttributes.getActionCount() != 0) {
if (logger.isDebugEnabled()) {
logger.debug("Ignoring action");
}
return;
}
formAttributes.setActionCount(1);
}
String value;
Element element;
// Generate the markup.
// @todo 2005060816 annotate child with style information if it's not inherited from the parent
element = dom.openStyledElement("filled", attributes);
// set any attribute values that should be applied for all form fields.
addFormFieldAttributes(element, attributes);
// If the field name is set for this action then we need to initialise
// a variable with the same name so the value will be submitted.
String fieldName = attributes.getName();
if (fieldName != null) {
value = attributes.getValue();
if (value == null) {
value = " ";
}
element = dom.addElement("var");
element.setAttribute("name", fieldName);
element.setAttribute("expr", value);
}
element = dom.addElement("submit");
// Check if processing an emulated XForm or real XFForm markup because
// we cannot populate the submit element's next and method attributes
// until later (after XFormEmulationTransformer) if it's emulated.
if (formAttributes != null) {
// Set the next and method attributes to those associated
// with the form
String resolvedHref = resolveFormAction(formAttributes);
element.setAttribute("next", resolvedHref);
element.setAttribute("method", formAttributes.getMethod());
// Set the namelist attribute to the fields defined in the
// form attributes.
StringBuffer buffer = new StringBuffer(URLConstants.FORM_PARAMETER);
for (Iterator i = formAttributes.getFields().iterator(); i.hasNext();) {
XFFormFieldAttributes field = (XFFormFieldAttributes) i.next();
// Ignore other action fields when generating the field names.
if (field != attributes && field instanceof XFActionAttributes) {