All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.forms.FormCardHandler

java.lang.Object
   |
   +----w3c.jigsaw.forms.FormCardHandler

public class FormCardHandler
extends Object
An HTML form card handler. The form handler class defined the behavior that form handlers are required to provide. The form manager ensures that calls to notifyBeginProcessing, notifyChange and notifyEndProcessing are atomic. This means that either the same thread will perform the three calls (without another thread preempting it), or it will fail with some exception, and won't call all notify callbacks.


Constructor Index

 o FormCardHandler()

Method Index

 o notifyBeginProcessing(FormCardResource, Request)
Notify the form handler that some card processing begins.
 o notifyButtonClick(String)
Notify the form handler that a button was clicked.
 o notifyChange(FormFieldInterface, Object)
Notify the form handler that some field has changed its value.
 o notifyEndProcessing(FormCardResource, Request)
Notify the form handler that some card processing is finished.
 o updateFormCard(FormCardResource)
Perform any update needed by the form.

Constructors

 o FormCardHandler
 public FormCardHandler()

Methods

 o notifyBeginProcessing
 public void notifyBeginProcessing(FormCardResource card,
                                   Request request) throws FormProcessingException
Notify the form handler that some card processing begins.

Parameters:
request - The request that will be processed.
card - The card whose processing is starting.
Throws: HTTPException
If the processing failed.
 o notifyEndProcessing
 public String notifyEndProcessing(FormCardResource card,
                                   Request request) throws FormProcessingException
Notify the form handler that some card processing is finished.

Parameters:
request - The request that we have finished to process.
card - The card whose processing is finished.
Returns:
An String encoded location (if relocation required), relative to the form card resource, or null.
Throws: FormProcessingException
If the processing failed.
 o notifyChange
 public void notifyChange(FormFieldInterface field,
                          Object value) throws FormFieldException
Notify the form handler that some field has changed its value.

Parameters:
name - The name of the field that changed.
value - Its new value.
Throws: FormFieldException
If the provided value was rejected by the handler.
 o notifyButtonClick
 public void notifyButtonClick(String label) throws FormProcessingException
Notify the form handler that a button was clicked.

Parameters:
label - The button label.
 o updateFormCard
 public FormCardResource updateFormCard(FormCardResource card)
Perform any update needed by the form. This method is called before creating the HTML for the form content. If the form state (field's value, or list of cards) needs some update, it is the right place to do it.

Parameters:
card - The card to be updated if needed.
Returns:
A fresh instance of FormCardResource, if the cardwas rebuilt, or null if the original card was preserved.

All Packages  Class Hierarchy  This Package  Previous  Next  Index