Package muntjac :: Package ui :: Module abstract_field :: Class AbstractField
[hide private]
[frames] | no frames]

Class AbstractField

source code

                            object --+                
                                     |                
                   util.IEventListener --+            
                                         |            
             terminal.paintable.IPaintable --+        
                                             |        
                                object --+   |        
                                         |   |        
    terminal.variable_owner.IVariableOwner --+        
                                             |        
                                object --+   |        
                                         |   |        
               terminal.sizeable.ISizeable --+        
                                             |        
                          component.IComponent --+    
                                                 |    
                                    object --+   |    
                                             |   |    
  event.method_event_source.IMethodEventSource --+    
                                                 |    
              abstract_component.AbstractComponent --+
                                                     |
                                object --+           |
                                         |           |
                   data.buffered.IBuffered --+       |
                                             |       |
                                object --+   |       |
                                         |   |       |
             data.validatable.IValidatable --+       |
                                             |       |
            data.buffered.IBufferedValidatable --+   |
                                                 |   |
                                    object --+   |   |
                                             |   |   |
            data.property.IValueChangeNotifier --+   |
                                                 |   |
                                    object --+   |   |
                                             |   |   |
            data.property.IValueChangeListener --+   |
                                                 |   |
                                object --+       |   |
                                         |       |   |
                     data.property.IViewer --+   |   |
                                             |   |   |
                         data.property.IEditor --+   |
                                                 |   |
                        object --+               |   |
                                 |               |   |
               util.IEventListener --+           |   |
                                     |           |   |
         terminal.paintable.IPaintable --+       |   |
                                         |       |   |
                            object --+   |       |   |
                                     |   |       |   |
terminal.variable_owner.IVariableOwner --+       |   |
                                         |       |   |
                            object --+   |       |   |
                                     |   |       |   |
           terminal.sizeable.ISizeable --+       |   |
                                         |       |   |
                      component.IComponent --+   |   |
                                             |   |   |
                          component.IFocusable --+   |
                                                 |   |
                                      field.IField --+
                                                     |
                                        object --+   |
                                                 |   |
                    event.action.IShortcutNotifier --+
                                                     |
                                        object --+   |
                                                 |   |
       data.property.IReadOnlyStatusChangeNotifier --+
                                                     |
                                        object --+   |
                                                 |   |
       data.property.IReadOnlyStatusChangeListener --+
                                                     |
                                                    AbstractField

Abstract field component for implementing buffered property editors. The field may hold an internal value, or it may be connected to any data source that implements the IPropertyinterface. AbstractField implements that interface itself, too, so accessing the IProperty value represented by it is straightforward.

AbstractField also provides the IBuffered interface for buffering the data source value. By default the IField is in write through-mode and setWriteThroughshould be called to enable buffering.

The class also supports validators to make sure the value contained in the field is valid.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self)
Constructs a new IComponent.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
shouldHideErrors(self)
Returns true if the error indicator be hidden when painting the component even when there are errors.
source code
 
getType(self) source code
 
isReadOnly(self)
The abstract field is read only also if the data source is in read only mode.
source code
 
setReadOnly(self, readOnly)
Changes the readonly state and throw read-only status change events.
source code
 
isInvalidCommitted(self)
Tests if the invalid data is committed to datasource.
source code
 
setInvalidCommitted(self, isCommitted)
Sets if the invalid data should be committed to datasource.
source code
 
commit(self)
Updates all changes since the previous commit to the data source.
source code
 
discard(self)
Discards all changes since last commit.
source code
 
isModified(self)
Tests if the value stored in the object has been modified since it was last updated from the data source.
source code
 
isWriteThrough(self)
Tests if the object is in write-through mode.
source code
 
setWriteThrough(self, writeThrough)
Sets the object's write-through mode to the specified status.
source code
 
isReadThrough(self)
Tests if the object is in read-through mode.
source code
 
setReadThrough(self, readThrough)
Sets the object's read-through mode to the specified status.
source code
 
__str__(self)
Returns the value of the IProperty in human readable textual format.
source code
 
getValue(self)
Gets the current value of the field.
source code
 
setValue(self, newValue, repaintIsNotNeeded=False)
Sets the value of the field.
source code
 
getPropertyDataSource(self)
Gets the current data source of the field, if any.
source code
 
setPropertyDataSource(self, newDataSource)
Sets the specified IProperty as the data source for the field.
source code
 
addValidator(self, validator)
Adds a new validator for the field's value.
source code
 
getValidators(self)
Gets the validators of the field.
source code
 
removeValidator(self, validator)
Removes the validator from the field.
source code
 
isValid(self)
Tests the current value against registered validators if the field is not empty.
source code
 
validate(self)
Checks the validity of the IValidatable by validating the field with all attached validators except when the field is empty.
source code
 
isInvalidAllowed(self)
Fields allow invalid values by default.
source code
 
setInvalidAllowed(self, invalidAllowed)
Fields allow invalid values by default.
source code
 
getErrorMessage(self)
Error messages shown by the fields are composites of the error message thrown by the superclasses (that is the component error message), validation errors and buffered source errors.
source code
 
addListener(self, listener, iface=None)
Registers a new (generic) component event listener for the component:
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes a previously registered component event listener from this component.
source code
 
removeCallback(self, callback, eventType=None) source code
 
fireValueChange(self, repaintIsNotNeeded)
Emits the value change event.
source code
 
readOnlyStatusChange(self, event)
React to read only status changes of the property by requesting a repaint.
source code
 
fireReadOnlyStatusChange(self)
Emits the read-only status change event.
source code
 
valueChange(self, event)
This method listens to data source value changes and passes the changes forwards.
source code
 
readValueFromProperty(self, event) source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
focus(self)
Sets the focus for this component if the component is IFocusable.
source code
 
getTabIndex(self)
Gets the tabulator index of the IFocusable component.
source code
 
setTabIndex(self, tabIndex)
Sets the tabulator index of the IFocusable component.
source code
 
setInternalValue(self, newValue)
Sets the internal field value.
source code
 
attach(self)
Notifies the component that it is connected to an application.
source code
 
detach(self)
Notifies the component that it is detached from the application.
source code
 
isRequired(self)
Is this field required.
source code
 
setRequired(self, required)
Sets the field required.
source code
 
setRequiredError(self, requiredMessage)
Set the error that is show if this field is required, but empty.
source code
 
getRequiredError(self)
Gets the error message that is to be displayed if a required field is empty.
source code
 
isEmpty(self)
Is the field empty?
source code
 
isValidationVisible(self)
Is automatic, visible validation enabled?
source code
 
setValidationVisible(self, validateAutomatically)
Enable or disable automatic, visible validation.
source code
 
setCurrentBufferedSourceException(self, currentBufferedSourceException)
Sets the current buffered source exception.
source code
 
getActionManager(self)
Gets the ActionManager used to manage the ShortcutListeners added to this IField.
source code
 
addShortcutListener(self, shortcut) source code
 
removeShortcutListener(self, shortcut) source code

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
constructField(cls, propertyType)
Creates abstract field by the type of the property.
source code
Class Variables [hide private]

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructs a new IComponent.

Overrides: object.__init__
(inherited documentation)

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)

shouldHideErrors(self)

source code 

Returns true if the error indicator be hidden when painting the component even when there are errors.

This is a mostly internal method, but can be overridden in subclasses e.g. if the error indicator should also be shown for empty fields in some cases.

Returns:
true to hide the error indicator, false to use the normal logic to show it when there are errors

isReadOnly(self)

source code 

The abstract field is read only also if the data source is in read only mode.

Returns:
True if the component or any of its parents is in read-only mode, False if not.
Overrides: component.IComponent.isReadOnly

setReadOnly(self, readOnly)

source code 

Changes the readonly state and throw read-only status change events.

Parameters:
  • readOnly - a boolean value specifying whether the component is put read-only mode or not
Overrides: component.IComponent.setReadOnly

isInvalidCommitted(self)

source code 

Tests if the invalid data is committed to datasource.

Overrides: data.buffered.IBufferedValidatable.isInvalidCommitted

See Also: BufferedValidatable.isInvalidCommitted

setInvalidCommitted(self, isCommitted)

source code 

Sets if the invalid data should be committed to datasource.

Overrides: data.buffered.IBufferedValidatable.setInvalidCommitted

See Also: BufferedValidatable.setInvalidCommitted

commit(self)

source code 

Updates all changes since the previous commit to the data source. The value stored in the object will always be updated into the data source when commit is called.

Raises:
  • SourceException - if the operation fails because of an exception is thrown by the data source. The cause is included in the exception.
  • InvalidValueException - if the operation fails because validation is enabled and the values do not validate
Overrides: data.buffered.IBuffered.commit
(inherited documentation)

discard(self)

source code 

Discards all changes since last commit. The object updates its value from the data source.

Raises:
  • SourceException - if the operation fails because of an exception is thrown by the data source. The cause is included in the exception.
Overrides: data.buffered.IBuffered.discard
(inherited documentation)

isModified(self)

source code 

Tests if the value stored in the object has been modified since it was last updated from the data source.

Returns:
True if the value in the object has been modified since the last data source update, False if not.
Overrides: data.buffered.IBuffered.isModified
(inherited documentation)

isWriteThrough(self)

source code 

Tests if the object is in write-through mode. If the object is in write-through mode, all modifications to it will result in commit being called after the modification.

Returns:
True if the object is in write-through mode, False if it's not.
Overrides: data.buffered.IBuffered.isWriteThrough
(inherited documentation)

setWriteThrough(self, writeThrough)

source code 

Sets the object's write-through mode to the specified status. When switching the write-through mode on, the commit operation will be performed.

Parameters:
  • writeThrough - Boolean value to indicate if the object should be in write-through mode after the call.
Raises:
  • SourceException - If the operation fails because of an exception is thrown by the data source.
  • InvalidValueException - If the implicit commit operation fails because of a validation error.
Overrides: data.buffered.IBuffered.setWriteThrough
(inherited documentation)

isReadThrough(self)

source code 

Tests if the object is in read-through mode. If the object is in read-through mode, retrieving its value will result in the value being first updated from the data source to the object.

The only exception to this rule is that when the object is not in write-through mode and it's buffer contains a modified value, the value retrieved from the object will be the locally modified value in the buffer which may differ from the value in the data source.

Returns:
True if the object is in read-through mode, False if it's not.
Overrides: data.buffered.IBuffered.isReadThrough
(inherited documentation)

setReadThrough(self, readThrough)

source code 

Sets the object's read-through mode to the specified status. When switching read-through mode on, the object's value is updated from the data source.

Parameters:
  • readThrough - Boolean value to indicate if the object should be in read-through mode after the call.
Raises:
  • SourceException - If the operation fails because of an exception is thrown by the data source. The cause is included in the exception.
Overrides: data.buffered.IBuffered.setReadThrough
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Returns the value of the IProperty in human readable textual format.

Overrides: object.__str__

getValue(self)

source code 

Gets the current value of the field.

This is the visible, modified and possible invalid value the user have entered to the field. In the read-through mode, the abstract buffer is also updated and validation is performed.

Note that the object returned is compatible with getType(). For example, if the type is String, this returns Strings even when the underlying datasource is of some other type. In order to access the datasources native type, use getPropertyDatasource().getValue() instead.

Note that when you extend AbstractField, you must reimplement this method if datasource.getValue() is not assignable to class returned by getType() AND getType() is not String. In case of Strings, getValue() calls datasource.toString() instead of datasource.getValue().

Returns:
the current value of the field.

setValue(self, newValue, repaintIsNotNeeded=False)

source code 

Sets the value of the field.

Parameters:
  • newValue - the new value of the field.
  • repaintIsNotNeeded - True iff caller is sure that repaint is not needed.
Raises:

getPropertyDataSource(self)

source code 

Gets the current data source of the field, if any.

Returns:
the current data source as a IProperty, or None if none defined.
Overrides: data.property.IViewer.getPropertyDataSource

setPropertyDataSource(self, newDataSource)

source code 

Sets the specified IProperty as the data source for the field. All uncommitted changes are replaced with a value from the new data source.

If the datasource has any validators, the same validators are added to the field. Because the default behavior of the field is to allow invalid values, but not to allow committing them, this only adds visual error messages to fields and do not allow committing them as long as the value is invalid. After the value is valid, the error message is not shown and the commit can be done normally.

Note: before 6.5 we actually called discard() method in the beginning of the method. This was removed to simplify implementation, avoid excess calls to backing property and to avoid odd value change events that were previously fired (developer expects 0-1 value change events if this method is called). Some complex field implementations might now need to override this method to do housekeeping similar to discard().

Parameters:
  • newDataSource - the new data source property.
Overrides: data.property.IViewer.setPropertyDataSource

addValidator(self, validator)

source code 

Adds a new validator for the field's value. All validators added to a field are checked each time the its value changes.

Parameters:
  • validator - the new validator to be added.
Overrides: data.validatable.IValidatable.addValidator

getValidators(self)

source code 

Gets the validators of the field.

Returns:
the Unmodifiable collection that holds all validators for the field.
Overrides: data.validatable.IValidatable.getValidators

removeValidator(self, validator)

source code 

Removes the validator from the field.

Parameters:
  • validator - the validator to remove.
Overrides: data.validatable.IValidatable.removeValidator

isValid(self)

source code 

Tests the current value against registered validators if the field is not empty. If the field is empty it is considered valid if it is not required and invalid otherwise. Validators are never checked for empty fields.

Returns:
True if all registered validators claim that the current value is valid or if the field is empty and not required, False otherwise.
Overrides: data.validatable.IValidatable.isValid

validate(self)

source code 

Checks the validity of the IValidatable by validating the field with all attached validators except when the field is empty. An empty field is invalid if it is required and valid otherwise.

The "required" validation is a built-in validation feature. If the field is required, but empty, validation will throw an EmptyValueException with the error message set with setRequiredError().

Raises:
Overrides: data.validatable.IValidatable.validate

isInvalidAllowed(self)

source code 

Fields allow invalid values by default. In most cases this is wanted, because the field otherwise visually forget the user input immediately.

Returns:
true iff the invalid values are allowed.
Overrides: data.validatable.IValidatable.isInvalidAllowed

setInvalidAllowed(self, invalidAllowed)

source code 

Fields allow invalid values by default. In most cases this is wanted, because the field otherwise visually forget the user input immediately.

In common setting where the user wants to assure the correctness of the datasource, but allow temporarily invalid contents in the field, the user should add the validators to datasource, that should not allow invalid values. The validators are automatically copied to the field when the datasource is set.

Raises:
  • NotImplementedError - if the setInvalidAllowed is not supported.
Overrides: data.validatable.IValidatable.setInvalidAllowed

getErrorMessage(self)

source code 

Error messages shown by the fields are composites of the error message thrown by the superclasses (that is the component error message), validation errors and buffered source errors.

Returns:
ErrorMessage containing the description of the error state of the component or null, if the component contains no errors. Extending classes should override this method if they support other error message types such as validation errors or buffering errors. The returned error message contains information about all the errors.
Overrides: abstract_component.AbstractComponent.getErrorMessage

addListener(self, listener, iface=None)

source code 

Registers a new (generic) component event listener for the component:

 class Listening(CustomComponent, IListener):

     # Stored for determining the source of an event
     ok = None

     status = None  # For displaying info about the event

     def __init__(self):
         layout = VerticalLayout()

         # Some miscellaneous component
         name = TextField("Say it all here")
         name.addListener(self)
         name.setImmediate(true)
         layout.addComponent(name)

         # Handle button clicks as generic events instead
         # of Button.ClickEvent events
         ok = new Button("OK")
         ok.addListener(self)
         layout.addComponent(ok)

         # For displaying information about an event
         status = new Label("")
         layout.addComponent(status)

         setCompositionRoot(layout)


     def componentEvent(event):
         # Act according to the source of the event
         if (event.getSource() == ok):
             getWindow().showNotification("Click!")

         status.setValue("Event from " +
                 event.getSource().__class__.__name__
                 + ": " + event.__class__.__name__)


 listening = Listening()
 layout.addComponent(listening)
Parameters:
  • listener - the new IListener to be registered.
Raises:
  • ValueError - unless method has a match in object
Overrides: data.property.IReadOnlyStatusChangeNotifier.addListener
(inherited documentation)

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: data.property.IReadOnlyStatusChangeNotifier.addCallback

removeListener(self, listener, iface=None)

source code 

Removes a previously registered component event listener from this component.

Parameters:
  • listener - the listener to be removed.
Overrides: data.property.IReadOnlyStatusChangeNotifier.removeListener
(inherited documentation)

removeCallback(self, callback, eventType=None)

source code 
Overrides: data.property.IReadOnlyStatusChangeNotifier.removeCallback

fireValueChange(self, repaintIsNotNeeded)

source code 

Emits the value change event. The value contained in the field is validated before the event is created.

readOnlyStatusChange(self, event)

source code 

React to read only status changes of the property by requesting a repaint.

Parameters:
  • event - Read-only status change event object
Overrides: data.property.IReadOnlyStatusChangeListener.readOnlyStatusChange

fireReadOnlyStatusChange(self)

source code 

Emits the read-only status change event. The value contained in the field is validated before the event is created.

valueChange(self, event)

source code 

This method listens to data source value changes and passes the changes forwards.

Changes are not forwarded to the listeners of the field during internal operations of the field to avoid duplicate notifications.

Parameters:
  • event - the value change event telling the data source contents have changed.
Overrides: data.property.IValueChangeListener.valueChange

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

focus(self)

source code 

Sets the focus for this component if the component is IFocusable.

Overrides: component.IFocusable.focus
(inherited documentation)

constructField(cls, propertyType)
Class Method

source code 

Creates abstract field by the type of the property.

This returns most suitable field type for editing property of given type.

Parameters:
  • propertyType - the Type of the property, that needs to be edited.

Deprecated: use e.g. DefaultFieldFactory.createFieldByPropertyType instead

getTabIndex(self)

source code 

Gets the tabulator index of the IFocusable component.

Returns:
tab index set for the IFocusable component
Overrides: component.IFocusable.getTabIndex
(inherited documentation)

setTabIndex(self, tabIndex)

source code 

Sets the tabulator index of the IFocusable component. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index:

 loginBox = Form()
 loginBox.setCaption("Login")
 layout.addComponent(loginBox)

 # Create the first field which will be focused
 username = TextField("User name")
 loginBox.addField("username", username)

 # Set focus to the user name
 username.focus()

 password = TextField("Password")
 loginBox.addField("password", password)

 login = Button("Login")
 loginBox.getFooter().addComponent(login)

 # An additional component which natural focus order would
 # be after the button.
 remember = CheckBox("Remember me")
 loginBox.getFooter().addComponent(remember)

 username.setTabIndex(1)
 password.setTabIndex(2)
 remember.setTabIndex(3)  # Different than natural place
 login.setTabIndex(4)

After all focusable user interface components are done, the browser can begin again from the component with the smallest tab index, or it can take the focus out of the page, for example, to the location bar.

If the tab index is not set (is set to zero), the default tab order is used. The order is somewhat browser-dependent, but generally follows the HTML structure of the page.

A negative value means that the component is completely removed from the tabulation order and can not be reached by pressing the Tab key at all.

Parameters:
  • tabIndex - the tab order of this component. Indexes usually start from 1. Zero means that default tab order should be used. A negative value means that the field should not be included in the tabbing sequence.
Overrides: component.IFocusable.setTabIndex
(inherited documentation)

setInternalValue(self, newValue)

source code 

Sets the internal field value. This is purely used by AbstractField to change the internal IField value. It does not trigger valuechange events. It can be overridden by the inheriting classes to update all dependent variables.

Parameters:
  • newValue - the new value to be set.

attach(self)

source code 

Notifies the component that it is connected to an application.

Overrides: component.IComponent.attach

See Also: IComponent.attach

detach(self)

source code 

Notifies the component that it is detached from the application.

The getApplication and getWindow methods might return None after this method is called.

The caller of this method is setParent if the parent is in the application. When the parent is detached from the application it is its response to call detach for all the children and to detach itself from the terminal.

Overrides: component.IComponent.detach
(inherited documentation)

isRequired(self)

source code 

Is this field required. Required fields must filled by the user.

If the field is required, it is visually indicated in the user interface. Furthermore, setting field to be required implicitly adds "non-empty" validator and thus isValid() == false or any isEmpty() fields. In those cases validation errors are not painted as it is obvious that the user must fill in the required fields.

On the other hand, for the non-required fields isValid() == true if the field isEmpty() regardless of any attached validators.

Returns:
True if the field is required, otherwise False.
Overrides: field.IField.isRequired

setRequired(self, required)

source code 

Sets the field required. Required fields must filled by the user.

If the field is required, it is visually indicated in the user interface. Furthermore, setting field to be required implicitly adds "non-empty" validator and thus isValid() == false or any isEmpty() fields. In those cases validation errors are not painted as it is obvious that the user must fill in the required fields.

On the other hand, for the non-required fields isValid() == true if the field isEmpty() regardless of any attached validators.

Parameters:
  • required - Is the field required.
Overrides: field.IField.setRequired

setRequiredError(self, requiredMessage)

source code 

Set the error that is show if this field is required, but empty. When setting requiredMessage to be "" or null, no error pop-up or exclamation mark is shown for a empty required field. This faults to "". Even in those cases isValid() returns false for empty required fields.

Parameters:
  • requiredMessage - Message to be shown when this field is required, but empty.
Overrides: field.IField.setRequiredError

getRequiredError(self)

source code 

Gets the error message that is to be displayed if a required field is empty.

Returns:
Error message.
Overrides: field.IField.getRequiredError
(inherited documentation)

isEmpty(self)

source code 

Is the field empty?

In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".

isValidationVisible(self)

source code 

Is automatic, visible validation enabled?

If automatic validation is enabled, any validators connected to this component are evaluated while painting the component and potential error messages are sent to client. If the automatic validation is turned off, isValid() and validate() methods still work, but one must show the validation in their own code.

Returns:
True, if automatic validation is enabled.

setValidationVisible(self, validateAutomatically)

source code 

Enable or disable automatic, visible validation.

If automatic validation is enabled, any validators connected to this component are evaluated while painting the component and potential error messages are sent to client. If the automatic validation is turned off, isValid() and validate() methods still work, but one must show the validation in their own code.

Parameters:
  • validateAutomatically - True, if automatic validation is enabled.

getActionManager(self)

source code 

Gets the ActionManager used to manage the ShortcutListeners added to this IField.

Returns:
the ActionManager in use

addShortcutListener(self, shortcut)

source code 
Overrides: event.action.IShortcutNotifier.addShortcutListener

removeShortcutListener(self, shortcut)

source code 
Overrides: event.action.IShortcutNotifier.removeShortcutListener