createForm - Create Form Flag

Creates a form element or not.

Category

basics

Syntax

createForm="true|false"
Where true forces creation of a form and false suppresses form creation.

Usage

In Design mode, click All Properties and look for createForm under basics.

You can create a custom form element in the Source editor. See the example for the specification of the default form.

By default (if this property is not specified), a form is created if one does not exist and a form is not created if one does exist.

Examples

This XPage suppressed form creation.
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" createForm="false">
	<xp:this.data>
		<xp:dominoDocument var="document1" formName="form1"></xp:dominoDocument>
	</xp:this.data>
	<xp:inputText id="inputText1" value="#{document1.subject}"
		style="font-weight:bold">
	</xp:inputText>
	<xp:button value="submit" id="button1" style="font-weight:bold">
		<xp:eventHandler event="onclick" submit="true"
			refreshMode="complete" immediate="false" save="true">
		</xp:eventHandler>
	</xp:button>
</xp:view>
It generates the following XML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title></title>
<script type="text/javascript" src="/domjs/dojo-1.3.2/dojo/dojo.js" djConfig="locale: 'en-us'"></script>
<script type="text/javascript" src="/domjs/dojo-1.3.2/ibm/xsp/widget/layout/xspClientDojo.js"></script>
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xsp.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspLTR.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspFF.css">
</head>
<body class="xspView tundra">
<input type="text" id="view:inputText1" name="view:inputText1" style="font-weight:bold" class="xspInputFieldEditBox"><button style="font-weight:bold" class="xspButtonSubmit" type="button" name="view:button1" id="view:button1">submit</button><script type="text/javascript">

XSP.addOnLoad(function() {
XSP.attachEvent("view:_id2", "view:button1", "onclick", null, true, false);
}); 

</script>

</body>
</html>
If the form is created (not suppressed), the XML is as follows:
<html lang="en">
<head>
<title></title>
<script type="text/javascript" src="/domjs/dojo-1.3.2/dojo/dojo.js" djConfig="locale: 'en-us'"></script>
<script type="text/javascript" src="/domjs/dojo-1.3.2/ibm/xsp/widget/layout/xspClientDojo.js"></script>
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xsp.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspLTR.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspFF.css">
</head>
<body class="xspView tundra">
<form id="view:_id1" method="post" action="/foo.nsf/xpage2.xsp" class="xspForm" enctype="multipart/form-data">
<input type="text" id="view:_id1:inputText1" name="view:_id1:inputText1" style="font-weight:bold" class="xspInputFieldEditBox"><button style="font-weight:bold" class="xspButtonSubmit" type="button" name="view:_id1:button1" id="view:_id1:button1">submit</button>

<input type="hidden" name="$$viewid" id="view:_id1__VUID" value="!cidukjk9dq!">
<input type="hidden" name="$$xspsubmitid">
<input type="hidden" name="$$xspexecid">
<input type="hidden" name="$$xspsubmitvalue">
<input type="hidden" name="$$xspsubmitscroll">
<input type="hidden" name="view:_id1" value="view:_id1"></form>
<script type="text/javascript">

XSP.addOnLoad(function() {
XSP.attachEvent("view:_id1:_id2", "view:_id1:button1", "onclick", null, true, false);
}); 

</script>
</body>
</html>