    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.

##

FormCardHandler()

##

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

##

FormCardHandler

     public FormCardHandler()

##

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.

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.

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.

notifyButtonClick

     public void notifyButtonClick(String label) throws FormProcessingException

  Notify the form handler that a button was clicked.

  Parameters:
    label - The button label.

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