org.apache.tapestry5.corelib.components
Class FormFragment
java.lang.Object
org.apache.tapestry5.corelib.components.FormFragment
- All Implemented Interfaces:
- ClientElement
@SupportsInformalParameters
public class FormFragment
- extends Object
- implements 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.
- See Also:
TriggerFragment
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FormFragment
public FormFragment()
getClientId
public String getClientId()
- Description copied from interface:
ClientElement
- Returns a unique id for the element. This value will be unique for any given rendering of a page. This value is
intended for use as the id attribute of the client-side element, and will be used with any DHTML/Ajax related
JavaScript.
- Specified by:
getClientId in interface ClientElement
Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.