Home » tapestry-src-5.0.19 » org.apache.tapestry5.corelib.components » [javadoc | source]
org.apache.tapestry5.corelib.components
public class: Form [javadoc | source]
java.lang.Object
   org.apache.tapestry5.corelib.components.Form

All Implemented Interfaces:
    ClientElement, FormValidationControl

An HTML form, which will enclose other components to render out the various types of fields.

A Form emits many notification events. When it renders, it fires a org.apache.tapestry5.EventConstants#PREPARE_FOR_RENDER notification, followed by a org.apache.tapestry5.EventConstants#PREPARE notification.

When the form is submitted, the component emits several notifications: first a org.apache.tapestry5.EventConstants#PREPARE_FOR_SUBMIT , then a org.apache.tapestry5.EventConstants#PREPARE : these allow the page to update its state as necessary to prepare for the form submission, then (after components enclosed by the form have operated), a org.apache.tapestry5.EventConstants#VALIDATE_FORM event is emitted, to allow for cross-form validation. After that, either a org.apache.tapestry5.EventConstants#SUCCESS OR org.apache.tapestry5.EventConstants#FAILURE event (depending on whether the ValidationTracker has recorded any errors). Lastly, a org.apache.tapestry5.EventConstants#SUBMIT event, for any listeners that care only about form submission, regardless of success or failure.

For all of these notifications, the event context is derived from the context parameter. This context is encoded into the form's action URI (the parameter is not read when the form is submitted, instead the values encoded into the form are used).
Field Summary
public static final  String PREPARE_FOR_RENDER   
     
    public static final  String PREPARE_FOR_SUBMIT   
       
      public static final  String PREPARE   
         
        public static final  String SUBMIT   
           
          public static final  String VALIDATE_FORM   
             
            public static final  String SUCCESS   
               
              public static final  String FAILURE   
                 
                public static final  String FORM_DATA    Query parameter name storing form data (the serialized commands needed to process a form submission). 
                Method from org.apache.tapestry5.corelib.components.Form Summary:
                afterRender,   beginRender,   cleanupRender,   clearErrors,   createRenderTimeFormSupport,   defaultValidationId,   getClientId,   getDefaultTracker,   getHasErrors,   isValid,   onAction,   recordError,   recordError,   setDefaultTracker,   setTracker,   setupRender
                Methods from java.lang.Object:
                clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
                Method from org.apache.tapestry5.corelib.components.Form Detail:
                  void afterRender(MarkupWriter writer) 
                  void beginRender(MarkupWriter writer) 
                  void cleanupRender() 
                 public  void clearErrors() 
                 InternalFormSupport createRenderTimeFormSupport(String name,
                    ComponentActionSink actionSink,
                    IdAllocator allocator) 
                 String defaultValidationId() 
                 public String getClientId() 
                  Forms use the same value for their name and their id attribute.
                 public ValidationTracker getDefaultTracker() 
                 public boolean getHasErrors() 
                 public boolean isValid() 
                 Object onAction(EventContext context) throws IOException 
                 public  void recordError(String errorMessage) 
                 public  void recordError(Field field,
                    String errorMessage) 
                 public  void setDefaultTracker(ValidationTracker defaultTracker) 
                  void setTracker(ValidationTracker tracker) 
                  void setupRender()