xfaction

Purpose

Used to create controls that cause specific actions both inside and outside forms.

You can use style properties in a theme on the containing canvas to specify how action controls and images are displayed. See Styling forms for more information.

Inside a form, the actions can include submitting the form and resetting the fields in it.

Outside forms, the type attribute is set to perform to indicate that the action is to be performed and is not a submit or reset action.

Contained by

Attribute groups

Attributes

Attribute Description Type Default Options Use
name The name of the action xs:string none    optional 
type The action type associated with the control xs:string none  submit, reset, perform  required 
value The value of the control xs:string none    optional 

Examples

<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/forms.mlyt" pageTitle="xfaction">
  <xfform name="formControls" action="download.jsp">
    <xfsiselect name="select" caption="Choose platform" captionPane="controlCaption1"
      entryPane="controlEntry1" initial="linux">
      <xfoption caption="Windows" value="windows"/>
      <xfoption caption="MacOS X" value="mac"/>
      <xfoption caption="Linux" value="linux"/>
    </xfsiselect>
    <xfaction type="submit" caption="Submit" captionPane="controlCaption2"
      entryPane="controlEntry2"/>
    <xfaction type="reset" caption="Reset" captionPane="controlCaption2"
      entryPane="controlEntry2"/>
  </xfform>
  <xfaction type="perform" caption="Perform" captionPane="controlCaption2"
    entryPane="controlEntry2"/>
</canvas>

For the purpose of this demonstration submitted data will be processed by a simple JSP.

<?xml version="1.0" encoding="UTF-8"?>
<%
response.setContentType("x-application/vnd.xdime+xml");
String platform = request.getParameter("select");
%>
<canvas layoutName="/welcome.mlyt" pageTitle="Forms in XDIME 1">
  <pane name="background">
    <p>You've chosen <%=platform%>!</p>
  </pane>
</canvas>

The forms.mlyt layout may have the following structure.

forms.mlyt

Related topics