= Class FormPanel (derived from SimplePanel) =

A panel that wraps its contents in an HTML "FORM" element.

This panel can be used to achieve interoperability with servers
that accept traditional HTML form encoding. The following widgets
will be submitted to the server if they are contained within this panel:

L{TextBox}, L{PasswordTextBox}, L{RadioButton}, L{CheckBox},
L{TextArea}, L{ListBox}, L{FileUpload} and L{Hidden}

In particular, FileUpload is only useful when used within a
L{FormPanel}, because the browser will only upload files using
form submission.

The example below calls Google to perform a search using
the query entered by the user into the text field. The
results are shown in a separate Frame. Alternatively,
you can call Form.addFormHandler(handler) to manually
process the results of posting the form. When this is done,
handler.onSubmit(event) will be called when the user is
about to submit the form; call event.setCancelled(True)
to cancel the event within this method. Also,
handler.onSubmitComplete(event) will be called when the
results of submitting the form are returned back to the
browser. Call event.getResults() to retrieve the (plain-text)
value returned by the server.

Note that if you use a ui.FileUpload widget in your form,
you must set the form encoding and method like this:

    self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
    self.form.setMethod(FormPanel.METHOD_POST)

This will ensure that the form is submitted in a way that
allows files to be uploaded.

Method resolution order:
 * FormPanel
 * SimplePanel
 * Panel
 * Widget
 * UIObject

== Methods defined: ==

 * __init__(self, target=None)

 * addFormHandler(self, handler)

 * getAction(self)

 * getEncoding(self)
{{-method
# FormPanelImpl.getEncoding
}}

 * getMethod(self)

 * getTarget(self)

 * getTextContents(self, iframe)
{{-method
# FormPanelImpl.getTextContents
}}

 * hookEvents(self, iframe, form, listener)
{{-method
# FormPanelImpl.hookEvents
}}

 * onAttach(self)

 * onDetach(self)

 * onFormSubmit(self)

 * onFrameLoad(self)

 * removeFormHandler(self, handler)

 * setAction(self, url)

 * setEncoding(self, encodingType)
{{-method
# FormPanelImpl.setEncoding
}}

 * setMethod(self, method)

 * setTarget(self, target)

 * submit(self)

 * submitImpl(self, form, iframe)
{{-method
# FormPanelImpl.submit
}}

 * unhookEvents(self, iframe, form)
{{-method
# FormPanelImpl.unhookEvents
}}



== Data and other attributes defined: ==

 * ENCODING_MULTIPART = 'multipart/form-data'
 * ENCODING_URLENCODED = 'application/x-www-form-urlencoded'
 * METHOD_GET = 'get'
 * METHOD_POST = 'post'


== Methods inherited from SimplePanel: ==

 * add(self, widget)

 * getContainerElement(self)

 * getWidget(self)

 * remove(self, widget)

 * setWidget(self, widget)



== Methods inherited from Panel: ==

 * __iter__(self)

 * adopt(self, widget, container=None)

 * clear(self)
{{-method
# TODO: fix iterator remove()
}}

 * disown(self, widget)

 * doAttachChildren(self)

 * doDetachChildren(self)



== Methods inherited from Widget: ==

 * getID(self)
{{-method
Get the id attribute of the associated DOM element.
}}

 * getLayoutData(self)

 * getParent(self)
{{-method
Widgets are kept in a hierarchy, and widgets that have been added to a panel
will have a parent widget that contains them.  This retrieves the containing
widget for this widget.
}}

 * isAttached(self)
{{-method
Return whether or not this widget has been attached to the document.
}}

 * onBrowserEvent(self, event)

 * onLoad(self, sender)

 * removeFromParent(self)
{{-method
Remove ourself from our parent.  The parent widget will call setParent(None) on
us automatically
}}

 * setID(self, id)
{{-method
Set the id attribute of the associated DOM element.
}}

 * setLayoutData(self, layoutData)

 * setParent(self, parent)
{{-method
Update the parent attribute.  If the parent is currently attached to the DOM this
assumes we are being attached also and calls onAttach().
}}



== Methods inherited from UIObject: ==

 * addStyleName(self, style)
{{-method
Append a style to the element associated with this UIObject.  This is
a CSS class name.  It will be added after any already-assigned CSS class for
the element.
}}

 * getAbsoluteLeft(self)

 * getAbsoluteTop(self)

 * getElement(self)
{{-method
Get the DOM element associated with the UIObject, if any
}}

 * getOffsetHeight(self)

 * getOffsetWidth(self)

 * getStyleName(self)

 * getTitle(self)

 * isVisible(self, element=None)
{{-method
Determine whether this element is currently visible, by checking the CSS
property 'display'
}}

 * removeStyleName(self, style)
{{-method
Remove a style from the element associated with this UIObject.  This is
a CSS class name.
}}

 * setElement(self, element)
{{-method
Set the DOM element associated with the UIObject.
}}

 * setHeight(self, height)
{{-method
Set the height of the element associated with this UIObject.  The
value should be given as a CSS value, such as 100px, 30%, or 50pi
}}

 * setPixelSize(self, width, height)
{{-method
Set the width and height of the element associated with this UIObject
in pixels.  Width and height should be numbers.
}}

 * setSize(self, width, height)
{{-method
Set the width and height of the element associated with this UIObject.  The
values should be given as a CSS value, such as 100px, 30%, or 50pi
}}

 * setStyleName(self, element, style=None, add=True)
{{-method
When called with a single argument, this replaces all the CSS classes
associated with this UIObject's element with the given parameter.  Otherwise,
this is assumed to be a worker function for addStyleName and removeStyleName.
}}

 * setTitle(self, title)

 * setVisible(self, element, visible=None)
{{-method
Set whether this element is visible or not.  If a single parameter is
given, the self.element is used.  This modifies the CSS property 'display',
which means that an invisible element not only is not drawn, but doesn't
occupy any space on the page.
}}

 * setWidth(self, width)
{{-method
Set the width of the element associated with this UIObject.  The
value should be given as a CSS value, such as 100px, 30%, or 50pi
}}

 * setzIndex(self, index)

 * sinkEvents(self, eventBitsToAdd)
{{-method
Request that the given events be delivered to the event handler for this
element.  The event bits passed are added (using inclusive OR) to the events
already "sunk" for the element associated with the UIObject.  The event bits
are a combination of values from class L{Event}.
}}

 * unsinkEvents(self, eventBitsToRemove)
{{-method
Reverse the operation of sinkEvents.  See L{UIObject.sinkEvents}.
}}

