|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.SComponent
org.wings.SContainer
org.wings.SForm
public class SForm
Container in which you need to wrap HTML input fields (ie. STextField)
to work correctly.
SForm.
| Field Summary | |
|---|---|
protected String |
actionCommand
|
static String |
ENC_TYPE_MULTIPART_FORM
Multipart form encoding. |
static String |
ENC_TYPE_TEXT_PLAIN
Default Form encoding type. |
protected EventListenerList |
listenerList
|
static String |
URL_ENCODING
URL form encoding. |
| Fields inherited from class org.wings.SComponent |
|---|
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME |
| Constructor Summary | |
|---|---|
SForm()
Create a standard form component. |
|
SForm(SLayoutManager layout)
Create a standard form component. |
|
SForm(URL action)
Create a standard form component but redirects the request to the passed URL. |
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener listener)
Add a listener for Form events. |
static void |
addArmedComponent(LowLevelEventListener component)
Register a components to be subject to fire component events in a later phase of the request processing. |
SComponent |
addComponent(SComponent c,
Object constraint,
int index)
Adds a component to the container with the given constraint at the given index. |
static void |
clearArmedComponents()
clear armed components. |
protected void |
fireActionPerformed(String pActionCommand)
Fire a ActionEvent at each registered listener. |
static void |
fireEvents()
This method fires the low level events for all "armed" components of this thread (http session) in an ordered manner: forms buttons / clickables "regular" components This order derives out of the assumption, that a user first modifies regular components before he presses the button submitting his changes. |
void |
fireFinalEvents()
Internal event trigger used by CGs. |
void |
fireIntermediateEvents()
fire events which describes a "in progress" state change, like TreeWillExpand, or ListSelectionEvent with getIsAdjusting() true, ... |
URL |
getAction()
|
String |
getActionCommand()
|
FormCG |
getCG()
Return the look and feel delegate. |
SButton |
getDefaultButton()
|
String |
getEncodingType()
Get the current encoding type, as set with setEncodingType(String). |
RequestURL |
getRequestURL()
The URL under which this component is accessible for the browser. |
boolean |
isEpochCheckEnabled()
Asks the low-level event listener if epoch checking should be perfomed on it. |
boolean |
isPostMethod()
Returns, whether this form is transmitted via POST (true)
or GET (false). |
void |
processLowLevelEvent(String action,
String[] values)
Deliver low level/http events (parameters). |
void |
registerFileChooser(SFileChooser fileChooser)
|
void |
removeActionListener(ActionListener listener)
Remove a form action listener, that has been added in addActionListener(ActionListener) |
void |
setAction(URL action)
|
void |
setActionCommand(String actionCommand)
A SForm fires an event each time it was triggered (i.e. |
void |
setCG(FormCG cg)
|
void |
setDefaultButton(SButton defaultButton)
Set the default button activated upon enter. |
void |
setEncodingType(String type)
Set the encoding of this form. |
void |
setEpochCheckEnabled(boolean epochCheckEnabled)
|
void |
setPostMethod(boolean postMethod)
Set, whether this form is to be transmitted via POST (true)
or GET (false). |
void |
unregisterFileChooser(SFileChooser fileChooser)
|
| Methods inherited from class org.wings.SContainer |
|---|
add, add, add, add, addComponent, addComponent, addComponent, addContainerListener, addNotify, clone, fireContainerEvent, getComponent, getComponentCount, getComponentList, getComponents, getConstraintAt, getConstraintList, getLayout, invite, inviteEachComponent, isShowingChildren, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCG, setLayout, setParentFrame, updateCG |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.wings.LowLevelEventListener |
|---|
getLowLevelEventId, getName, isEnabled |
| Field Detail |
|---|
public static final String ENC_TYPE_TEXT_PLAIN
setEncodingType(String).
public static final String ENC_TYPE_MULTIPART_FORM
setEncodingType(String).
public static final String URL_ENCODING
setEncodingType(String).
protected final EventListenerList listenerList
protected String actionCommand
| Constructor Detail |
|---|
public SForm()
public SForm(URL action)
action - The target URL.public SForm(SLayoutManager layout)
layout - The layout to apply to this container.SContainer| Method Detail |
|---|
public void setActionCommand(String actionCommand)
actionCommand - The action command to place insiside the ActionEventpublic String getActionCommand()
setActionCommand(String)public void setDefaultButton(SButton defaultButton)
defaultButton - A button which will be rendered invisible.
If null enter key pressed will be catched by the wings framework.public SButton getDefaultButton()
setDefaultButton(SButton)public void addActionListener(ActionListener listener)
SFileChooser will trigger a form event, if the file
size exceeded the allowed size. In that case, even if the submit
button has been pressed, no submit-button event will be triggered.
(For details, see SFileChooser).
public void removeActionListener(ActionListener listener)
addActionListener(ActionListener)
protected void fireActionPerformed(String pActionCommand)
public static void addArmedComponent(LowLevelEventListener component)
SForm will call
LowLevelEventListener.fireIntermediateEvents() and later
LowLevelEventListener.fireFinalEvents() in a later phase of
the request. The calls on the components will be ordered dependend on their type.
component - The component to callback for event firing in a later phase of the requestfireEvents()public static void clearArmedComponents()
public static void fireEvents()
public void setPostMethod(boolean postMethod)
POST (true)
or GET (false). The default, and this is what you
usually want, is POST.
public boolean isPostMethod()
POST (true)
or GET (false).
Default is true.
true if form postedt via POST,
false if via GET (false).public void setEncodingType(String type)
application/x-www-form-urlencoded, and as such, needn't
be explicitly set with this setter. However, if you've included a
file upload element (as represented by SFileChooser) in your
form, this must be set to multipart/form-data, since only
then, files are transmitted correctly. In 'normal' forms without
file upload, it is not necessary to set it to
multipart/form-data; actually it enlarges the data to
be transmitted, so you probably don't want to do this, then.
type - the encoding type; one of multipart/form-data,
application/x-www-form-urlencoded or null to detect encoding.public String getEncodingType()
setEncodingType(String). If no encoding type was set, this
method detects the best encoding type. This can be expensive, so if
you can, set the encoding type.
multipart/form-data,
application/x-www-form-urlencoded .. or 'null'
by default.public void registerFileChooser(SFileChooser fileChooser)
public void unregisterFileChooser(SFileChooser fileChooser)
public void setAction(URL action)
public URL getAction()
public RequestURL getRequestURL()
SComponentReloadResource
externalizer.
getRequestURL in class SComponent
public void processLowLevelEvent(String action,
String[] values)
LowLevelEventListener
processLowLevelEvent in interface LowLevelEventListenerprocessLowLevelEvent in class SComponentaction - the name-value-pair's namevalues - the name-value-pair's valuespublic void fireIntermediateEvents()
LowLevelEventListener
fireIntermediateEvents in interface LowLevelEventListenerpublic void fireFinalEvents()
SComponent
fireFinalEvents in interface LowLevelEventListenerfireFinalEvents in class SComponentpublic boolean isEpochCheckEnabled()
LowLevelEventListenertrue the Dispatcher will ignore request originating from old views
(typically iniated by triggering browser back and clicking somewhere.)
isEpochCheckEnabled in interface LowLevelEventListenertrue if epoch checking should be perfomed, false
if all request for this component should be processed.LowLevelEventListener.isEpochCheckEnabled()public void setEpochCheckEnabled(boolean epochCheckEnabled)
LowLevelEventListener.isEpochCheckEnabled()
public SComponent addComponent(SComponent c,
Object constraint,
int index)
SContainer
addComponent in class SContainerc - the component to addindex - the index of the component
public void setCG(FormCG cg)
public FormCG getCG()
SComponent
getCG in class SComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||