to.etc.domui.dom.html
Interface IControl<T>

All Superinterfaces:
IActionControl, IDisplayControl<T>, IHasChangeListener, INodeErrorDelegate
All Known Subinterfaces:
IInputNode<T>
All Known Implementing Classes:
AbstractDivControl, Checkbox, ComboComponentBase, ComboFixed, ComboFixedClientFilter, ComboLookup, DateInput, DisplayOnlyPropertyBinding, FCKEditor, HiddenText, HtmlEditor, LookupInput, SelectBasedControl, SimpleComponentPropertyBinding, SpanBasedControl, Text, TextArea, TextStr

public interface IControl<T>
extends IDisplayControl<T>, IActionControl, IHasChangeListener, INodeErrorDelegate

Something to control a control: some input or control comnponent in a generic way. This interface is allowed to be implemented on non-nodebase object. FIXME Should this also be a IBindable control?

Author:
Frits Jalvingh Created on Dec 6, 2009

Method Summary
 java.lang.String getErrorLocation()
          When set this contains a user-understandable tekst indicating which control has the error.
 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 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.
 void setReadOnly(boolean ro)
          Sets the input to readonly-mode.
 
Methods inherited from interface to.etc.domui.dom.html.IDisplayControl
getValue, setTestID, setValue
 
Methods inherited from interface to.etc.domui.dom.html.IActionControl
setDisabled, setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IHasChangeListener
getOnValueChanged, setOnValueChanged
 
Methods inherited from interface to.etc.domui.dom.errors.INodeErrorDelegate
clearMessage, getMessage, setMessage
 

Method Detail

getValueSafe

T getValueSafe()
Like 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 hasError() or use IDisplayControl.getValue() instead of this call.

Returns:

hasError

boolean hasError()
Returns T if this control is currently in error state, meaning it's input is in some way invalid. This call internally calls getValue() to ensure it's error state is valid for the current data held.

Returns:

isReadOnly

boolean isReadOnly()
Returns T if the control is currently in readonly mode. Controls that do not have a readonly ability (comboboxes) will use disabled as the readonly state. For those controls the readonly state mirrors the disabled state.

Returns:

setReadOnly

void setReadOnly(boolean ro)
Sets the input to readonly-mode. Components that do not implement readonly mode (comboboxes) will usually set themselves to disabled which works much the same.

Parameters:
ro -

isDisabled

boolean isDisabled()
Returns T if the control is currently in disabled. Controls that do not have a readonly ability (comboboxes) will use disabled as the readonly state. For those controls the readonly state mirrors the disabled state.

Returns:

isMandatory

boolean isMandatory()
Returns T if this control is a mandatory input.

Returns:

setMandatory

void setMandatory(boolean ro)
Make the control mandatory.

Parameters:
ro -

setErrorLocation

void setErrorLocation(java.lang.String errorLocation)
When set this contains a user-understandable tekst indicating which control has the error. It usually contains the "label" associated with the control, and is set automatically by form builders if possible.

Parameters:
errorLocation -

getErrorLocation

java.lang.String getErrorLocation()
When set this contains a user-understandable tekst indicating which control has the error. It usually contains the "label" associated with the control, and is set automatically by form builders if possible.

Returns: