|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FormItem
FormDecorator instance in the velocity.

The java code to create the above yes-no-switch looks as follows. Please note
the anonymous class creation style, with a initializer block. This helps
grouping the code: 
The form item goes to a velocity page under defined name, e.g. dateSwitch, and the corresponding logical panels are accessed with the following convention:

FormDecorator
which can be accessed for example as $f.hasError("dateSwitch").
The FormItem is aggregated within FormItemContainer and both
together form the composite pattern.
They play together with the Component and Container
Initial Date: 24.11.2006
| Field Summary | |
|---|---|
static java.lang.String |
ERRORC
|
static java.lang.String |
EXAMPLEC
|
static java.lang.String |
LABELC
|
| Fields inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider |
|---|
DISPPREFIX |
| Method Summary | |
|---|---|
void |
addActionListener(Controller listener,
int events)
|
void |
clearError()
error is resolved, e.g. |
void |
doDispatchFormRequest(UserRequest ureq)
called if this component is dispatched, e.g. |
void |
evalFormRequest(UserRequest ureq)
called if just the form values must be remembered for the next render process. |
int |
getAction()
|
java.util.List |
getActionListenersFor(int event)
|
Component |
getComponent()
The elements panel to be rendered by the GUI Framework. |
Component |
getErrorC()
a complex "error" message, or a helper wizard to fix the error may be |
java.lang.String |
getErrorText()
This method is used by a form infrastructure provider. |
Component |
getExampleC()
translated example text, wrapped in component |
java.lang.String |
getExampleText()
This method is used by a form infrastructure provider. |
Component |
getLabelC()
label panel of the form item, null if no label
provided/rendered |
java.lang.String |
getLabelText()
label panel of the form item, null if no label
provided/rendered |
java.lang.String |
getName()
The form item's name within an manageing form container. |
Form |
getRootForm()
a form item always has a root container where it belongs to. |
Translator |
getTranslator()
|
java.lang.Object |
getUserObject()
|
boolean |
hasError()
|
boolean |
hasExample()
|
boolean |
hasFocus()
true if this element tries to get focus. |
boolean |
hasLabel()
|
boolean |
isEnabled()
true if item is marked as editable. |
boolean |
isMandatory()
true if the form item should contain a (valid) value. |
boolean |
isVisible()
true if form item was marked visible. |
void |
reset()
reset the data in the field to a initial/predefined value. |
void |
setEnabled(boolean isEnabled)
item is enabled/disabled, e.g. |
void |
setErrorComponent(FormItem errorFormItem,
FormLayouter container)
a complex "error" message, or a helper wizard to fix the error. It must be a form item itself, that starting the fixing workflow let the surrounding form evaluate (intermediate save values). Typically a FormLink is used here to start a workflow in a modal
dialog.Use showError(true) for the visibility of the error. |
void |
setErrorKey(java.lang.String errorKey,
java.lang.String[] params)
Sets the i18n key for this form item's error message and displays the error message if showErro(true) is set. |
void |
setExampleKey(java.lang.String exampleKey,
java.lang.String[] params)
key for example with params to fill |
void |
setFocus(boolean hasFocus)
true if the element should (try to) get focus, false is default |
void |
setLabel(java.lang.String labelkey,
java.lang.String[] params)
Key to be translated with the form translator and placed in the label panel. |
FormItem |
setLabelComponent(FormItem labelComponent,
FormItemContainer formLayout)
see setErrorComponent for comments |
void |
setMandatory(boolean isMandatory)
Shows a mandatory icon next to this form item. |
void |
setRootForm(Form rootForm)
|
void |
setTranslator(Translator translator)
|
void |
setUserObject(java.lang.Object userObject)
|
void |
setVisible(boolean isVisible)
item, label, example, error get not visible |
void |
showError(boolean show)
|
void |
showExample(boolean show)
|
void |
showLabel(boolean show)
|
void |
validate(java.util.List validationResults)
validate the data in the field, create error messages or update any component. |
| Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider |
|---|
getFormDispatchId |
| Field Detail |
|---|
static final java.lang.String ERRORC
static final java.lang.String EXAMPLEC
static final java.lang.String LABELC
| Method Detail |
|---|
void evalFormRequest(UserRequest ureq)
This method must be implemented by a specialised form item provider.
ureq - dispatchIDs - nextPos - void validate(java.util.List validationResults)
This method must be implemented by a specialised form item provider.
void reset()
void setFocus(boolean hasFocus)
hasFocus - boolean hasFocus()
void doDispatchFormRequest(UserRequest ureq)
Please note, that the caller is not the GUI Framework but the form items
manageing class. A default and exemplary implemention is Form.
This method must be implemented by a specialised form item provider.
ureq - dispatchIDs - nextPos - java.lang.String getName()
FormItemImpl uses the name to make the
element available in the velocity container.
This method is used by a form infrastructure provider.
Component getComponent()
Form getRootForm()
This method must be implemented by a specialised form item provider.
Component getLabelC()
null if no label
provided/rendered
This method is used by a form infrastructure provider.
java.lang.String getLabelText()
null if no label
provided/rendered
This method is used by a form infrastructure provider.
void setLabel(java.lang.String labelkey,
java.lang.String[] params)
labelkey - i18n keyparams - i18n key parameters
FormItem setLabelComponent(FormItem labelComponent,
FormItemContainer formLayout)
labelComponent - layout - boolean isMandatory()
void setMandatory(boolean isMandatory)
isMandatory - Whether this form item should have a mandatory icon.
void setErrorKey(java.lang.String errorKey,
java.lang.String[] params)
errorKey - i18n key for the error message.params - Additional error message contents.
void setErrorComponent(FormItem errorFormItem,
FormLayouter container)
FormLink is used here to start a workflow in a modal
dialog.
errorFormItem - container - the container containing the form item which has the errorComponent getErrorC()
This method is used by a form infrastructure provider. null
java.lang.String getErrorText()
This method is used by a form infrastructure provider.
Component getExampleC()
This method is used by a form infrastructure provider.
java.lang.String getExampleText()
This method is used by a form infrastructure provider.
void setExampleKey(java.lang.String exampleKey,
java.lang.String[] params)
exampleKey, - null to clear exampleparams, - may be nullvoid setTranslator(Translator translator)
translator - Translator getTranslator()
void setVisible(boolean isVisible)
isVisible - boolean isVisible()
void setEnabled(boolean isEnabled)
isEnabled - boolean isEnabled()
boolean hasError()
boolean hasLabel()
boolean hasExample()
void setRootForm(Form rootForm)
rootForm - void showLabel(boolean show)
show - void showError(boolean show)
show - void clearError()
void showExample(boolean show)
show -
void addActionListener(Controller listener,
int events)
listener - events - java.util.List getActionListenersFor(int event)
event -
int getAction()
void setUserObject(java.lang.Object userObject)
userObject - java.lang.Object getUserObject()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||