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

All Implemented Interfaces:
    ClientElement

A FormFragment is a portion of a Form that may be selectively displayed. Form elements inside a FormFragment will automatically bypass validation when the fragment is invisible. The trick is to also bypass server-side form processing for such fields when the form is submitted; client-side logic "removes" the form data for the fragment if it is invisible when the form is submitted; alternately, client-side logic can simply remove the form fragment element (including its visible and hidden fields) to prevent server-side processing.

The client-side element has a new property, formFragment, added to it. The formFragment object has new methods to control the client-side behavior of the fragment:

hide()
Hides the element, using the configured client-side animation effect.
hideAndRemove()
As with hide(), but the element is removed from the DOM after being hidden.
show()
Makes the element visible, using the configured client-side animation effect.
toggle()
Invokes hide() or show() as necessary.
setVisible()
Passed a boolean parameter, invokes hide() or show() as necessary.
Method from org.apache.tapestry5.corelib.components.FormFragment Summary:
afterRender,   beginRender,   defaultElement,   getClientId
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tapestry5.corelib.components.FormFragment Detail:
  void afterRender(MarkupWriter writer) 
  void beginRender(MarkupWriter writer) 
 String defaultElement() 
 public String getClientId()