Class DBLNumberField

Description

DBLNumberField is field designed to hold and enter numerical values.

It allows you to specify reqular expression to check the entered value and the minumim/maximum allowed value. If you do not wish the minimum/maximum check, set min to be greater than max. The check is off by default, btw. (The min is set to 0 and max to -1.)

It also prints the field value aligned to right. This can be overridden by setting the indexAttributes/detailAttributes property back to empty string after creating the field.

There are more specialized versions of this field (DBLIntegerdField, DBLMoneyField) which take advantage of this DBLNumberField's features.

Located in /DBLNumberField.php (line 25)

DBLField
   |
   --DBLTextField
      |
      --DBLNumberField
Direct descendents
Class Description
DBLIntegerField Field to view/edit integer numbers.
DBLCurrencyField Field to view/edit currency.
Variable Summary
string $allowedRE
string $detailFormat
string $editFormat
string $indexFormat
double $maxVal
double $minVal
Method Summary
DBLNumberField DBLNumberField (string $name, string $titleTxt, mixed $titleHTML, int $size, int $maxLen, string $titleHtml)
void checkValue (mixed $value, mixed &$err, mixed &$r, mixed $new)
void formatDetail (mixed $value, mixed &$r)
void formatEdit (mixed $value, mixed &$r, mixed $dataSource, mixed $formName)
void formatIndex (mixed $value, mixed &$r)
void jsCheck (mixed $formName, mixed $new)
Variables
string $allowedRE (line 52)
  • var: Regular expression to check if the field's value is a number. By default this is '^-?[0-9]*(\.[0-9]+)?$' which matches a float/integer number.
string $detailFormat (line 42)
  • var: Sprintf-like format of the number in the record detail. Default is '%f'.
string $editFormat (line 38)
  • var: Sprintf-like format of the number in the edit box. Default is '%f'.
string $indexFormat (line 46)
  • var: Sprintf-like format of the number in the record index. Default is '%f'.
double $maxVal (line 34)
  • var: Maximum allowed value.
double $minVal (line 30)
  • var: Minumum allowed value.

Inherited Variables

Inherited from DBLTextField

DBLTextField::$editSize
DBLTextField::$filterSize
DBLTextField::$maxLen

Inherited from DBLField

DBLField::$addAsterixes
DBLField::$allowEmpty
DBLField::$computed
DBLField::$dbName
DBLField::$default
DBLField::$detailAttributes
DBLField::$detailPostfix
DBLField::$detailPrefix
DBLField::$editAttributes
DBLField::$editPostfix
DBLField::$editPrefix
DBLField::$filterAttributes
DBLField::$filterPostfix
DBLField::$filterPrefix
DBLField::$indexAttributes
DBLField::$indexPostfix
DBLField::$indexPrefix
DBLField::$lookupField
DBLField::$name
DBLField::$needsMultipart
DBLField::$noOrderByTitle
DBLField::$readOnly
DBLField::$referenceURL
DBLField::$titleHTML
DBLField::$titleTxt
DBLField::$widgetAttributes
Methods
Constructor DBLNumberField (line 63)

Constructor

DBLNumberField DBLNumberField (string $name, string $titleTxt, mixed $titleHTML, int $size, int $maxLen, string $titleHtml)
  • string $name: Name of the field - see DBLField
  • string $titleTxt: Textual title - see DBLField
  • string $titleHtml: HTML title - see DBLField
  • int $size: Size of the widget - see DBLTextField
  • int $maxLen: Maximum length of the widget - see DBLTextField
checkValue (line 142)
void checkValue (mixed $value, mixed &$err, mixed &$r, mixed $new)

Redefinition of:
DBLField::checkValue()
Check value (from post)
formatDetail (line 94)
void formatDetail (mixed $value, mixed &$r)

Redefinition of:
DBLField::formatDetail()
Format field for record detail.
formatEdit (line 99)
void formatEdit (mixed $value, mixed &$r, mixed $dataSource, mixed $formName)

Redefinition of:
DBLTextField::formatEdit()
formatIndex (line 88)
void formatIndex (mixed $value, mixed &$r)

Redefinition of:
DBLField::formatIndex()
Format field for record index.
jsCheck (line 107)
void jsCheck (mixed $formName, mixed $new)

Redefinition of:
DBLField::jsCheck()
Create javascript to check the field value before post.

Inherited Methods

Inherited From DBLTextField

DBLTextField::DBLTextField()
DBLTextField::formatEdit()
DBLTextField::formatFilter()
DBLTextField::formatWidget()

Inherited From DBLField

DBLField::DBLField()
DBLField::acceptFilterValue()
DBLField::acceptValue()
DBLField::addCondition()
DBLField::checkValue()
DBLField::formatDetail()
DBLField::formatEdit()
DBLField::formatFilter()
DBLField::formatIndex()
DBLField::jsCheck()
DBLField::setTitle()
DBLField::splitValue()

Documentation generated on Mon, 6 Sep 2004 21:57:15 +0200 by phpDocumentor 1.2.3