<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ --> 
<html>
<head>
<title>ValidField</title>
<link rel="stylesheet" type="text/css" href="Tapestry.css" title="style">
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 <tr>
  <td align="left"><A href="Upload.html"><IMG alt=Upload src="common-images/prev.png"></a></td>  
  <td align="right"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>  
 <tr>
 <tr>
  <td colspan="2"><hr></td>  
 </tr>
 <tr>
  <td colspan="2">
   <table border="0" cellpadding="4" cellspacing="4" width="100%">

<tr valign="top">
 <td>
  <table>
	 <tr>
	  <td><font size="+2"><b>ValidField</b></font></td>
	 </tr>
	 <tr>
	  <td>
		 <A href="../api/net/sf/tapestry/valid/ValidField.html">
		 net.sf.tapestry.valid.ValidField</a>
		</td>
	 </tr>
  </table>
 </td>
 <td>
  <table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8">
	 <tr>
	  <td><b>Age</b></td><td><input style="BACKGROUND: yellow"></td>
	 </tr>
  </table>
 </td>
</tr>

<tr valign="center">
 <td colspan="2">&nbsp;</td>
</tr>

<tr>
 <td colspan="2">
  <b>Description</b>
	<br>
  Provides an extended <a href="TextField.html">TextField</a> that performs 
  automated validation and conversion of user entered text into typed Objects.
  The ValidField component is rendered as a HTML &lt;input type="text"&gt; field 
  and must be wrapped by a <a href="Form.html">Form</a> component.   
  <p>
  Each ValidField is configured with a 
  <A href="../api/net/sf/tapestry/valid/IValidator.html">validator</a> which 
  checks the correctness of the user's input and performs the input text to 
  java Object translations. The <a href="Form.html">Form</a> tracks the state of 
  all its ValidFields using a validation  
  <a href="../api/net/sf/tapestry/valid/ValidationDelegate.html">delegate</a>.
  Using the validation delegate you can determine whether all the form's fields
  are valid and inform the user of any validation errors. 
  <p>
  There are number of pluggable validators you can assign to a ValidField 
  including: 
  <ul>
   <li>
    <A href="../api/net/sf/tapestry/valid/DateValidator.html">DateValidator</a>
    - validates date strings and allows a minimum and maximum date range to be set 
   </li>
   <li>
    <A href="../api/net/sf/tapestry/valid/NumberValidator.html">NumberValidator</a> 
    - validates number strings and allows a minimum and maximum values to be set
   </li>
   <li>
    <A href="../api/net/sf/tapestry/valid/StringValidator.html">StringValidator</a> 
    - validates string values and allows a minimum length to be set 
   </li>
  </ul>
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>See Also</b>
	<br>
	<A href="FieldLabel.html">FieldLabel</a>, 
	<A href="Form.html">Form</a>, 
  <a href="TextArea.html">TextArea</a>,
  <A href="TextField.html">TextField</a>
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>Parameters</b>
	<br>	
  <table border=1 cellpadding="4" cellspacing="4" class="parameters">
  <tr>
   <th>Name</th>
   <th>Type</th>
	 <th>Direction</th>
   <th>Required</th>
   <th>Default</th>
   <th>Description</th>
  </tr>
  <tr>
   <td>value</td>
   <td>Object</td>
   <td>in-out</td>
 	 <td>yes</td>
	 <td>&nbsp;</td>
	 <td>
   The value to be displayed (on render), and updated (when the form is
   submitted, if the submitted value is valid). The
   <a href="../api/net/sf/tapestry/valid/IValidator/html"><tt>IValidator</tt></a>
   converts between object values and Strings.
   </td>
	</tr>
  <tr>
   <td>validator</td>
   <td>
    <A href="../api/net/sf/tapestry/valid/IValidator/html"><tt>IValidator</tt></a>
   </td>
   <td>in</td>
   <td>yes</td>
   <td>&nbsp;</td>
   <td>
   Object used to convert object values to Strings (for renderring)
   and to validate and convert Strings into object values (when the form
   is submitted).
   </td>
  </tr>
  <tr>
   <td>displayName</td>
   <td>String</td>
   <td>in</td>
   <td>yes</td>
   <td>&nbsp;</td>
   <td>
    A textual name for the field that is used when formulating error messages.
 	  Also used by the <A href="FieldLabel.html">FieldLabel</a> component to 
    properly label the field.
   </td>
  </tr>
	<tr>
	 <td>hidden</td>
	 <td>boolean</td>
	 <td>in</td>
	 <td>no</td>
	 <td>false</td>
	 <td>
    If true, then the text field is written as a &lt;input type="password"&gt; 
    form element.
   </td>
  </tr>
    <tr>
   <td>type</td>
   <td>String</td>
   <td>in</td>
 	 <td>no</td>
	 <td>Object</td>
	 <td>
The name of a class, to convert input into.
Required by some validators to identify the type of conversion from
String (typically, validators that convert a numeric amount). 
If the class is in package <tt>java.lang</tt>, then the package name can be ommitted.
Also, the names of Java scalar types are acceptible.
   </td>
	</tr>
	<tr>
	 <td>hidden</td>
	 <td>boolean</td>
	 <td>in</td>
	 <td>no</td>
	 <td>false</td>
	 <td>
    If true, then the text field is written as a &lt;input type="password"&gt; 
    form element.
   </td>
  </tr>
  <tr>
   <td>disabled</td>
   <td>boolean</td>
   <td>in</td>
   <td>no</td>
   <td>false</td>
   <td>
    Controls whether the text field is active or not.  If disabled, then
		any value that comes up when the form is submitted is ignored. Corresponds 
    to the "disabled" HTML attribute.
   </td>
	</tr>
	<tr>
	 <td>displayWidth</td>
	 <td>integer</td>
	 <td>in</td>
	 <td>no</td>
	 <td>&nbsp;</td>
	 <td>
   Controls the display width of the text control in the client browser.  If
	 unspecified or zero, then the width is left to the client browser to
	 determine. Corresponds to the "size" HTML attribute.
   </td> 
  </tr>
	<tr>
	 <td>maximumLength</td>
	 <td>integer</td>
   <td>in</td>
   <td>no</td>
	 <td>&nbsp;</td>
	 <td>
    Controls the maximum characters that the text control will accept.  If
		unspecified or zero, then the value is left to the client browser to
		determine. Corresponds to the "maxlength" HTML attribute.
   </td> 
  </tr>
	</table>
            <P>Body: <STRONG>removed</STRONG><BR>Informal parameters: 
            <STRONG>allowed</STRONG>
    <br>
  Reserved 
            parameters: "name", "type", "value" </P>
      
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>Examples</b>
  <p>
  Provides a date validation field.
	<p>

<table class="examples" cellpadding="8">
<tr valign="center">
 <td><b>Enquiry date</b></td> 
 <td><input style="BACKGROUND: yellow" name="example4" value="11/37/2002"></td>
</tr>
</table>

<pre>
&lt;form jwcid="form"&gt;
 &lt;table&gt;
  &lt;tr&gt;								
   &lt;td&gt;&lt;span jwcid="dateLabel"/&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input jwcid="<span class="jwcid">dateField</span>" displayName="Enquiry Date"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/table&gt;
&lt;/form&gt;


&lt;bean name="validationDelegate" class="<A href="../api/net/sf/tapestry/valid/ValidationDelegate.html">net.sf.tapestry.valid.ValidationDelegate</a>"/&gt;
    
&lt;bean name="dateValidator" class="<A href="../api/net/sf/tapestry/valid/DateValidator.html">net.sf.tapestry.valid.DateValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
&lt;/bean&gt;

&lt;component id="form" type="<A href="Form.html">Form</a>"&gt;
    &lt;binding name="listener" expression="listeners.formSubmit"/&gt;
    &lt;binding name="delegate" expression="beans.validationDelegate"/&gt;
&lt;/component&gt;
    
&lt;component id="dateLabel" type="<A href="FieldLabel.html">FieldLabel</a>"&gt;
    &lt;binding name="field" expression="components.dateField"/&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">dateField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="visit.enquiryDate"/&gt;
    &lt;binding name="validator" expression="beans.dateValidator"/&gt;
&lt;/component&gt;


public class EnquiryPage extends BasePage {
    public void formSubmit(IRequestCycle cycle) {
        // Process enquiry date
    }
}

public class Visit implements Serializable {
    private Date enquiryDate = new Date();

    public Date getEnquiryDate() { return enquiryDate; }

    public void setEnquiryDate(Date value) {
        enquiryDate = value;
    }
}
</pre>

 </td></tr></table>
</td></tr>
<tr>
 <td colspan="2"><hr></td>  
</tr>
<tr>
  <td align="left"><A href="Upload.html"><IMG alt=Upload src="common-images/prev.png"></a></td>  
  <td align="right"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>  
</tr>
</table>

</body>
</html><commit_msg>Improved example<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ --> 
<html>
<head>
<title>ValidField</title>
<link rel="stylesheet" type="text/css" href="Tapestry.css" title="style">
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 <tr>
  <td align="left"><A href="Upload.html"><IMG alt=Upload src="common-images/prev.png"></a></td>  
  <td align="right"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>  
 <tr>
 <tr>
  <td colspan="2"><hr></td>  
 </tr>
 <tr>
  <td colspan="2">
   <table border="0" cellpadding="4" cellspacing="4" width="100%">

<tr valign="top">
 <td>
  <table>
	 <tr>
	  <td><font size="+2"><b>ValidField</b></font></td>
	 </tr>
	 <tr>
	  <td>
		 <A href="../api/net/sf/tapestry/valid/ValidField.html">
		 net.sf.tapestry.valid.ValidField</a>
		</td>
	 </tr>
  </table>
 </td>
 <td>
  <table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8">
	 <tr>
	  <td><b>Age</b></td><td><input style="BACKGROUND: yellow"></td>
	 </tr>
  </table>
 </td>
</tr>

<tr valign="center">
 <td colspan="2">&nbsp;</td>
</tr>

<tr>
 <td colspan="2">
  <b>Description</b>
	<br>
  Provides an extended <a href="TextField.html">TextField</a> that performs 
  automated validation and conversion of user entered text into typed Objects.
  The ValidField component is rendered as a HTML &lt;input type="text"&gt; field 
  and must be wrapped by a <a href="Form.html">Form</a> component.   
  <p>
  Each ValidField is configured with a 
  <A href="../api/net/sf/tapestry/valid/IValidator.html">validator</a> which 
  checks the correctness of the user's input and performs the input text to 
  java Object translations. The <a href="Form.html">Form</a> tracks the state of 
  all its ValidFields using a validation  
  <a href="../api/net/sf/tapestry/valid/ValidationDelegate.html">delegate</a>.
  Using the validation delegate you can determine whether all the form's fields
  are valid and inform the user of any validation errors. 
  <p>
  There are number of pluggable validators you can assign to a ValidField 
  including: 
  <ul>
   <li>
    <A href="../api/net/sf/tapestry/valid/DateValidator.html">DateValidator</a>
    - validates date strings and allows a minimum and maximum date range to be set 
   </li>
   <li>
    <A href="../api/net/sf/tapestry/valid/NumberValidator.html">NumberValidator</a> 
    - validates number strings and allows a minimum and maximum values to be set
   </li>
   <li>
    <A href="../api/net/sf/tapestry/valid/StringValidator.html">StringValidator</a> 
    - validates string values and allows a minimum length to be set 
   </li>
  </ul>
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>See Also</b>
	<br>
	<A href="FieldLabel.html">FieldLabel</a>, 
	<A href="Form.html">Form</a>, 
  <a href="TextArea.html">TextArea</a>,
  <A href="TextField.html">TextField</a>
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>Parameters</b>
	<br>	
  <table border=1 cellpadding="4" cellspacing="4" class="parameters">
  <tr>
   <th>Name</th>
   <th>Type</th>
	 <th>Direction</th>
   <th>Required</th>
   <th>Default</th>
   <th>Description</th>
  </tr>
  <tr>
   <td>value</td>
   <td>Object</td>
   <td>in-out</td>
 	 <td>yes</td>
	 <td>&nbsp;</td>
	 <td>
   The value to be displayed (on render), and updated (when the form is
   submitted, if the submitted value is valid). The
   <a href="../api/net/sf/tapestry/valid/IValidator.html"><tt>IValidator</tt></a>
   converts between object values and Strings.
   </td>
	</tr>
  <tr>
   <td>validator</td>
   <td>
    <A href="../api/net/sf/tapestry/valid/IValidator.html"><tt>IValidator</tt></a>
   </td>
   <td>in</td>
   <td>yes</td>
   <td>&nbsp;</td>
   <td>
   Object used to convert object values to Strings (for renderring)
   and to validate and convert Strings into object values (when the form
   is submitted).
   </td>
  </tr>
  <tr>
   <td>displayName</td>
   <td>String</td>
   <td>in</td>
   <td>yes</td>
   <td>&nbsp;</td>
   <td>
    A textual name for the field that is used when formulating error messages.
 	  Also used by the <A href="FieldLabel.html">FieldLabel</a> component to 
    properly label the field.
   </td>
  </tr>
	<tr>
	 <td>hidden</td>
	 <td>boolean</td>
	 <td>in</td>
	 <td>no</td>
	 <td>false</td>
	 <td>
    If true, then the text field is written as a &lt;input type="password"&gt; 
    form element.
   </td>
  </tr>
    <tr>
   <td>type</td>
   <td>String</td>
   <td>in</td>
 	 <td>no</td>
	 <td>Object</td>
	 <td>
The name of a class, to convert input into.
Required by some validators to identify the type of conversion from
String (typically, validators that convert a numeric amount). 
If the class is in package <tt>java.lang</tt>, then the package name can be ommitted.
Also, the names of Java scalar types are acceptible.
   </td>
	</tr>
	<tr>
	 <td>hidden</td>
	 <td>boolean</td>
	 <td>in</td>
	 <td>no</td>
	 <td>false</td>
	 <td>
    If true, then the text field is written as a &lt;input type="password"&gt; 
    form element.
   </td>
  </tr>
  <tr>
   <td>disabled</td>
   <td>boolean</td>
   <td>in</td>
   <td>no</td>
   <td>false</td>
   <td>
    Controls whether the text field is active or not.  If disabled, then
		any value that comes up when the form is submitted is ignored. Corresponds 
    to the "disabled" HTML attribute.
   </td>
	</tr>
	<tr>
	 <td>displayWidth</td>
	 <td>integer</td>
	 <td>in</td>
	 <td>no</td>
	 <td>&nbsp;</td>
	 <td>
   Controls the display width of the text control in the client browser.  If
	 unspecified or zero, then the width is left to the client browser to
	 determine. Corresponds to the "size" HTML attribute.
   </td> 
  </tr>
	<tr>
	 <td>maximumLength</td>
	 <td>integer</td>
   <td>in</td>
   <td>no</td>
	 <td>&nbsp;</td>
	 <td>
    Controls the maximum characters that the text control will accept.  If
		unspecified or zero, then the value is left to the client browser to
		determine. Corresponds to the "maxlength" HTML attribute.
   </td> 
  </tr>
	</table>
  <p>Body: <strong>removed</strong><br>
  Informal parameters:<strong>allowed</strong><br>
  Reserved parameters: "name", "type", "value" 
  </p>      
 </td>
</tr>

<tr>
 <td colspan="2">
  <b>Examples</b>
  <p>
  The ValidField is used in this example to provide an auction bidding page. A
  custom
  <a href="../api/net/sf/tapestry/valid/ValidationDelegate.html"><tt>ValidationDelegate</tt></a>
  is used to render the invalid fiels as yellow. A custom ShowError component 
  is also used to display the first error message if any fields have errors. 
	<p>
  For a more extensive example see the 
  <a href="..\Tutorial\workbench.html">Tapestry Workbench</a>. The Fields 
  example in the Workbench also illustrates how to use the 
  <a href="FieldLabel.html">FieldLabel</a> component to high light invalid 
  fields.
	<p>

<form>
<table class="examples" cellpadding="2">
<tr>
 <td colspan="2"><font color="navy" size="+2"><i><b>Regal Auctions Bid Page</b></i></font></td>
</tr>
<tr>
 <td colspan="2"><hr></td>
</tr>
<tr>
 <td colspan="2"><font color="red">Bid Amount must be greater than 10.0</font></td>
</tr>
<tr>
 <td>Lot Number</td><td><input type="text" size="4" maxlength="4" value="23"/></td>
</tr>
<tr>
 <td>Bid Amount</td><td><input type="text" size="7" maxlength="7" value="9.99" style="background:yellow"/></td>
</tr>
<tr>
 <td>Full Name</td><td><input type="text" size="25" maxlength="30" value="<NAME>"/></td>
</tr>
<tr>
 <td>Email</td><td><input type="text" size="25" maxlength="30" value="<EMAIL>"/></td>
</tr>
<tr>
 <td>Telphone</td><td><input type="text" size="25" maxlength="12" style="background:yellow"/></td>
</tr>
<tr>
 <td colspan="2" align="right">
  <input type="Submit" value="   OK   ">
  <input type="Submit" value="Cancel">
 </td>
</tr>
</table>
</form>

<pre>
&lt;form jwcid="form"&gt;
&lt;table class="examples" cellpadding="2"&gt;
&lt;tr&gt;
 &lt;td colspan="2"&gt;&lt;span class="title"&gt;Regal Auctions Bid Page&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td colspan="2"&gt;&lt;hr&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td colspan="2"&gt;&lt;span jwcid="showError"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td&gt;Lot Number&lt;/td&gt;&lt;td&gt;&lt;input jwcid="<span class="jwcid">lotNoField</span>" type="text"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td&gt;Bid Amount&lt;/td&gt;&lt;td&gt;&lt;input jwcid="<span class="jwcid">bidAmountField</span>" type="text"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td&lt;Full Name&lt;/td&gt;&lt;td&gt;&lt;input jwcid="<span class="jwcid">fullNameField</span>" type="text"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td&gt;Email&lt;/td&gt;&lt;td&gt;&lt;input jwcid="<span class="jwcid">emailField</span>" type="text"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td&gt;Telphone&lt;/td&gt;&lt;td&gt;&lt;input jwcid="<span class="jwcid">telephoneField</span>" type="text"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td colspan="2" align="right"&gt;
  &lt;input jwcid="okSubmit" type="Submit" value="   OK   "&gt;
  &lt;input jwcid="cancelSubmit" type="Submit" value="Cancel"&gt;
 &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;


&lt;bean name="delegate" class="com.mycorp.FormValidationDelegate"/&gt;

&lt;bean name="lotNoValidator" class="<A href="../api/net/sf/tapestry/valid/NumberValidator.html">net.sf.tapestry.valid.NumberValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
    &lt;set-property name="minimum"&gt;
        &lt;static-value type="int"&gt;1&lt;/static-value&gt;
    &lt;/set-property>
    &lt;set-property name="maximum"&gt;
        &lt;property-value expression="auctionDetails.numberLots"/&gt;
    &lt;/set-property&gt;
&lt;/bean&gt;

&lt;bean name="bidAmountValidator" class="<A href="../api/net/sf/tapestry/valid/NumberValidator.html">net.sf.tapestry.valid.NumberValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
    &lt;set-property name="minimum"&gt;
        &lt;property-value expression="auctionDetails.minBid"/&gt;
    &lt;/set-property>
    &lt;set-property name="maximum"&gt;
        &lt;property-value expression="auctionDetails.maxBid"/&gt;
    &lt;/set-property&gt;
&lt;/bean&gt;

&lt;bean name="fullNameValidator" class="<A href="../api/net/sf/tapestry/valid/StringValidator.html">net.sf.tapestry.valid.StringValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
    &lt;set-property name="minimum"&gt;
        &lt;static-value type="float"&gt;3&lt;/static-value&gt;
    &lt;/set-property>
&lt;/bean&gt;

&lt;bean name="emailValidator" class="<A href="../api/net/sf/tapestry/valid/StringValidator.html">net.sf.tapestry.valid.StringValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
    &lt;set-property name="minimum"&gt;
        &lt;static-value type="float"&gt;12&lt;/static-value&gt;
    &lt;/set-property>
&lt;/bean&gt;

&lt;bean name="telephoneValidator" class="<A href="../api/net/sf/tapestry/valid/StringValidator.html">net.sf.tapestry.valid.StringValidator</a>"&gt;
    &lt;set-property name="required"&gt;
        &lt;field-value field-name="Boolean.TRUE"/&gt;
    &lt;/set-property&gt;
    &lt;set-property name="minimum"&gt;
        &lt;static-value type="float"&gt;11&lt;/static-value&gt;
    &lt;/set-property>
&lt;/bean&gt;

&lt;component id="form" type="<A href="Form.html">Form</a>"&gt;
    &lt;binding name="listener" expression="listeners.formSubmit"/&gt;
    &lt;binding name="delegate" expression="beans.delegate"/&gt;
&lt;/component&gt;

&lt;component id="showError" type="ShowError"&gt;
    &lt;binding name="delegate" expression="beans.delegate"/&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">lotNoField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="lotBid.lotNo"/&gt;
    &lt;binding name="validator" expression="beans.lotNoValidator"/&gt;
    &lt;static-binding name="displayName"&gt;Lot Number&lt;/static-binding&gt;
    &lt;static-binding name="displayWidth"&gt;4&lt;/static-binding&gt;
    &lt;static-binding name="maximumLength"&gt;4&lt;/static-binding&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">bidAmountField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="lotBid.bidAmount"/&gt;
    &lt;binding name="validator" expression="beans.bidAmountNoValidator"/&gt;
    &lt;static-binding name="displayName"&gt;Bid Amount&lt;/static-binding&gt;
    &lt;static-binding name="displayWidth"&gt;7&lt;/static-binding&gt;
    &lt;static-binding name="maximumLength"&gt;7&lt;/static-binding&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">fullNameField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="lotBid.bidderName"/&gt;
    &lt;binding name="validator" expression="beans.fullNameValidator"/&gt;
    &lt;static-binding name="displayName"&gt;Full Name&lt;/static-binding&gt;
    &lt;static-binding name="displayWidth"&gt;25&lt;/static-binding&gt;
    &lt;static-binding name="maximumLength"&gt;30&lt;/static-binding&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">emailField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="lotBid.bidderEmail"/&gt;
    &lt;binding name="validator" expression="beans.emailValidator"/&gt;
    &lt;static-binding name="displayName"&gt;Email&lt;/static-binding&gt;
    &lt;static-binding name="displayWidth"&gt;25&lt;/static-binding&gt;
    &lt;static-binding name="maximumLength"&gt;30&lt;/static-binding&gt;
&lt;/component&gt;

&lt;component id="<span class="jwcid">telephoneField</span>" type="<A href="ValidField.html">ValidField</a>"&gt;
    &lt;binding name="value" expression="lotBid.bidderTelephone"/&gt;
    &lt;binding name="validator" expression="beans.telephoneValidator"/&gt;
    &lt;static-binding name="displayName"&gt;Telephone&lt;/static-binding&gt;
    &lt;static-binding name="displayWidth"&gt;25&lt;/static-binding&gt;
    &lt;static-binding name="maximumLength"&gt;30&lt;/static-binding&gt;
&lt;/component&gt;

&lt;component id="okSubmit" type="<A href="Submit.html">Submit</a>"&gt;
    &lt;binding name="listener" expression="listeners.okSubmit"/&gt;
&lt;/component&gt;

&lt;component id="cancelSubmit" type="<A href="Submit.html">Submit</a>"&gt;
    &lt;binding name="listener" expression="listeners.cancelSubmit"/&gt;
&lt;/component&gt;


public class LotBidPage extends BasePage {
    private LotBid lotBid = new LotBid();
    private ActionDetails actionDetails;

    public LotBid getLotBid() { return lotBid; }

    public void setLotBid(LotBid value) {
        lotBid = value;
        fireObservedChange("lotBid", value);
    }

    public AuctionDetails getAuctionDetails() { return auctionDetails; }

    public void setAuctionDetails(AuctionDetails value) {
        auctionDetails = value;
        fireObservedChange("auctionDetails", value);
    }

    public void detach() {
        lotBid = new LotBid();
        actionDetails = null;
        super.detach();        
    }

    public void okSubmit(IRequestCycle cycle) {
        ValidationDelegate delegate = (ValidationDelegate) 
            getBeans().getBean("delegate");

        // If no errors process the bid, otherwise stay on this page and 
        // let the fields show their errors.
        if (!delegate.getHasErrors())
            // Save the lot bid to the database.
            ..
            
            // Go to the confirmation page.
            cycle.setPage("BidConfirmPage");
        }
    }
    
    public void cancelSubmit(IRequestCycle cycle) {
        cycle.setPage("AuctionListPage");
    }

    public void formSubmit(IRequestCycle cycle) { }        
}

public class LotBid implements Serializable {
    private int lotNo;
    private float bidAmount;
    private String bidderName;
    private String bidderEmail;
    private String bidderTelephone;

    public int getLotNo() { return lotNo; }
    
    public void setLotNo(int value) {
        lotNo = value;
    }

    public float getBidAmount() { return bidAmount; }
    
    public void setBidAmount(float value) {
        bidAmount = value;
    }
                  
    public float getBidderName() { return bidderName; }
    
    public void setBidderName(String value) {
        bidderName = value;
    }
    
    public float getBidderEmail() { return bidderEmail; }
    
    public void setBidderEmail(String value) {
        bidderEmail = value;
    }
    
    public float getBidderTelephone() { return bidderTelephone; }
    
    public void setBidderTelephone(String value) {
        bidderTelephone = value;
    }    
}

public class AuctionDetails implements Serializable {
    private int numberLots;
    private float minBid;
    private float maxBid;
    
    public AuctionDetails(int numberLots, float minBid, float maxBid) {
        this.numberLots = numberLots;
        this.minBid = minBid;
        this.maxBid = maxBid;
    }
    
    public int getNumberLots() { return numberLots; }
    
    public float getMinBid() { return minBid; }

    public float getMaxBid() { return maxBid; }    
}
</pre>

 </td></tr></table>
</td></tr>
<tr>
 <td colspan="2"><hr></td>  
</tr>
<tr>
  <td align="left"><A href="Upload.html"><IMG alt=Upload src="common-images/prev.png"></a></td>  
  <td align="right"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>  
</tr>
</table>

</body>
</html>
{'fraction_non_alphanumeric': 0.18404094010614103, 'fraction_numerical': 0.004890068233510235, 'mean_word_length': 3.8871804371989627, 'pattern_counts': {'":': 0, '<': 785, '<?xml version=': 0, '>': 790, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3421932', 'n_tokens_mistral': 9808, 'n_tokens_neox': 9421, 'n_words': 2116}