adapforms.runtime.events
Class AbstractFormHook

java.lang.Object
  extended by adapforms.runtime.events.AbstractFormHook
All Implemented Interfaces:
FormHook

public abstract class AbstractFormHook
extends java.lang.Object
implements FormHook

Abstract class that can be extended for domain applications that do not wish to implement all the event types specified in FormHook.

Author:
Henrik Gammelmark, geemark@cs.au.dk

Constructor Summary
AbstractFormHook()
           
 
Method Summary
 void onRepeatEntryAdd(FormInstance instance, FormPath path, int entryID)
          A repeat entry has been added to the form.
 void onRepeatEntryRemove(FormInstance instance, FormPath path, int entryID)
          A repeat entry has been removed from the form.
 void onValueChange(FormInstance instance, ElementState state)
          Invoked by the framework when the value of a form element changes (for each element that have had this hook added).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFormHook

public AbstractFormHook()
Method Detail

onRepeatEntryAdd

public void onRepeatEntryAdd(FormInstance instance,
                             FormPath path,
                             int entryID)
Description copied from interface: FormHook
A repeat entry has been added to the form.

Specified by:
onRepeatEntryAdd in interface FormHook
Parameters:
instance - Instance in question
path - Full path to the new instance (including entryID). To get the path of the actual repeat element, use FormPath.getRuntimeParent().
entryID - The ID of the entry added. This is the unique positive integer denoting this entry.

onRepeatEntryRemove

public void onRepeatEntryRemove(FormInstance instance,
                                FormPath path,
                                int entryID)
Description copied from interface: FormHook
A repeat entry has been removed from the form.
Notice that at this point, the associated data has already been removed from the form, and thus the given path cannot be used to look up entered data.

Specified by:
onRepeatEntryRemove in interface FormHook
Parameters:
instance - Instance in question
path - Full path to the deleted instance (including entryID). To get the path of the actual repeat element, use FormPath.getRuntimeParent().
entryID - The ID of the entry added. This is the unique positive integer denoting this entry.

onValueChange

public void onValueChange(FormInstance instance,
                          ElementState state)
Description copied from interface: FormHook
Invoked by the framework when the value of a form element changes (for each element that have had this hook added).

The hook is invoked also if the new value causes validation errors and if the value was deleted.

Specified by:
onValueChange in interface FormHook
Parameters:
instance - Instance in question
state - The current state of the affected element