Used to contain a value or a variable required for form processing
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
class | Assigns a class name to an element | xs:NMTOKEN | none | optional | |
clientVariableName | Passes a variable name to the form rather than a value | xs:string | none | optional | |
expr | An MCS expression | xs:string | none | optional | |
id | Assigns an identifier to an element | xs:ID | none | optional | |
name | The name of the action | xs:string | none | required | |
value | The value passed to the form | xs:string | none | required |
<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/forms.mlyt" pageTitle="xfimplicit">
<xfform name="formControls" action="download.jsp">
<xfsiselect name="select" caption="Choose platform" captionPane="controlCaption1"
entryPane="controlEntry1">
<xfoption caption="Windows" value="windows"/>
<xfoption caption="MacOS X" value="mac"/>
<xfoption caption="Linux" value="linux"/>
</xfsiselect>
<xfimplicit name="offer" value="Download4free"/>
<xfaction type="submit" caption="Download" captionPane="controlCaption2"
entryPane="controlEntry2"/>
</xfform>
</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");
String offer = request.getParameter("offer");
%>
<canvas layoutName="/welcome.mlyt" pageTitle="Forms in XDIME 1">
<pane name="background">
<h4><%=offer%></h4>
<p>You've chosen <%=platform%>!</p>
</pane>
</canvas>
The forms.mlyt layout may have the following structure.