|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.component.form.DisplayOnlyPropertyBinding<T>
public class DisplayOnlyPropertyBinding<T>
A property binding specific for display-only controls. This binding will abort any attempt to put the associated displayonly field into a state that is not allowed (like setting it to editable, enabled or not-readonly).
Constructor Summary | |
---|---|
DisplayOnlyPropertyBinding(IReadOnlyModel<?> model,
PropertyMetaModel<T> propertyMeta,
IDisplayControl<T> control)
|
Method Summary | |
---|---|
void |
clearMessage()
Remove this-component's "current" error message, if present. |
java.lang.String |
getErrorLocation()
When set this contains a user-understandable tekst indicating which control has the error. |
UIMessage |
getMessage()
|
IValueChanged<?> |
getOnValueChanged()
|
T |
getValue()
Returns the current value of this input component. |
T |
getValueSafe()
Like IDisplayControl.getValue() this returns the value of the component, but this returns null
if the value was invalid. |
boolean |
hasError()
Returns T if this control is currently in error state, meaning it's input is in some way invalid. |
boolean |
isDisabled()
Returns T if the control is currently in disabled. |
boolean |
isMandatory()
Returns T if this control is a mandatory input. |
boolean |
isReadOnly()
Returns T if the control is currently in readonly mode. |
void |
moveControlToModel()
|
void |
moveModelToControl()
|
void |
setControlsEnabled(boolean on)
|
void |
setDisabled(boolean d)
Set the input to disabled mode. |
void |
setErrorLocation(java.lang.String errorLocation)
When set this contains a user-understandable tekst indicating which control has the error. |
void |
setMandatory(boolean ro)
Make the control mandatory. |
UIMessage |
setMessage(UIMessage m)
This sets a message (an error, warning or info message) on this control. |
void |
setOnValueChanged(IValueChanged<?> listener)
|
void |
setReadOnly(boolean ro)
Sets the input to readonly-mode. |
void |
setTestID(java.lang.String testID)
Set the testID for external test software. |
void |
setValue(T value)
Set a new value into this control. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DisplayOnlyPropertyBinding(IReadOnlyModel<?> model, PropertyMetaModel<T> propertyMeta, IDisplayControl<T> control)
Method Detail |
---|
public void moveControlToModel() throws java.lang.Exception
moveControlToModel
in interface IModelBinding
java.lang.Exception
public void moveModelToControl() throws java.lang.Exception
moveModelToControl
in interface IModelBinding
java.lang.Exception
public void setControlsEnabled(boolean on)
setControlsEnabled
in interface IModelBinding
public T getValue()
ValidationException
. This means that this
call either delivers correct input (as defined by it's converter and validators), null
(when empty) or throws an exception. When a ValidationException occurs the framework
mostly ignores it - it does not produce a stacktrace or error in the client. Instead
the resulting error as posted by the error handling framework gets displayed on the
form when the request completes.
To get the value of a component while ignoring exceptions call #getValueSafe()
.
getValue
in interface IDisplayControl<T>
public void setValue(T value)
setValue
in interface IDisplayControl<T>
public T getValueSafe()
IDisplayControl.getValue()
this returns the value of the component, but this returns null
if the value was invalid. For this method NULL either means the value was invalid OR
it's content was empty. To distinguish between the two call IControl.hasError()
or use
IDisplayControl.getValue()
instead of this call.
getValueSafe
in interface IControl<T>
IControl.getValueSafe()
public IValueChanged<?> getOnValueChanged()
getOnValueChanged
in interface IHasChangeListener
IHasChangeListener.getOnValueChanged()
public void setOnValueChanged(IValueChanged<?> listener)
setOnValueChanged
in interface IHasChangeListener
public boolean hasError()
hasError
in interface IControl<T>
IControl.hasError()
public boolean isDisabled()
IControl
isDisabled
in interface IControl<T>
public void setDisabled(boolean d)
setDisabled
in interface IActionControl
IActionControl.setDisabled(boolean)
public boolean isMandatory()
IControl
isMandatory
in interface IControl<T>
public void setMandatory(boolean ro)
setMandatory
in interface IControl<T>
IControl.setMandatory(boolean)
public boolean isReadOnly()
IControl
isReadOnly
in interface IControl<T>
public void setReadOnly(boolean ro)
setReadOnly
in interface IControl<T>
IControl.setReadOnly(boolean)
public void setTestID(java.lang.String testID)
setTestID
in interface IActionControl
setTestID
in interface IDisplayControl<T>
public void clearMessage()
INodeErrorDelegate
clearMessage
in interface INodeErrorDelegate
INodeErrorDelegate.clearMessage()
public UIMessage getMessage()
getMessage
in interface INodeErrorDelegate
public UIMessage setMessage(UIMessage m)
INodeErrorDelegate
setMessage
in interface INodeErrorDelegate
public java.lang.String getErrorLocation()
IControl
getErrorLocation
in interface IControl<T>
public void setErrorLocation(java.lang.String errorLocation)
IControl
setErrorLocation
in interface IControl<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |