Datamanager 2 simple text widget

As with all subclasses, the actual initialization is done in the initialize() function, not in the constructor, to allow for error handling.

This widget supports all types which have a simple, plain text representation accessible though their value member.

Available configuration options:

  • int maxlength: The maximum length of the string allowed for this field. This includes any newlines, which account as at most two characters, depending on the OS. If you specify a 0, no maximum length is set. If you specify a -1, maximum length is inherited from the type, if applicable or unlimited otherwise. If a maximum length is set, an appropriate validation rule is created implicitly. A -1 setting is processed during startup and has no effect at a later time.
  • boolean hideinput: Set this to true if you want to hide the input in the widget, this usually means that a password HTML element will be used, instead of a regular text input widget. Defaults to false.
package midcom.helper.datamanager2

 Methods

_on_initialize ()

The initialization event handler post-processes the maxlength setting.

Returns

booleanIndicating Success

add_elements_to_form ($attributes)

Adds a simple single-line text form element at this time.

Parameters

$attributes

get_default ()

sync_type_with_widget ($results)

Parameters

$results

validate_number ($fields)

QF Validation callback used for number types.

It checks the number boundaries accordingly.

Parameters

$fields

 Properties

 

boolean $hideinput

whether the input should be shown in the widget, or not.
 

int $maxlength

Maximum length of the string encapsulated by this type.

0 means no limit. -1 tries to bind to the types maxlength member, if available.