Class DBLJSLCField

Description

This implements another type of lookup combo field (see DBLLCField).

'Lookup' is a field where the value is chosen from a set of values AND that set of values is got from a query. It is usually used to allow user edit a 1:N (one-too-many) relationship.

DBLJSLCField uses external popup window where user can select the record. It tightly cooperates with DBLExternalSelector, which can be used to provide such selection. This is meant to allow selecting from many records.

The filter this field implements is textual, the same as (for example) DBLTextField has. It searches the textual version.

SIDE NOTE: This class should be actually a descendant of both DBLLCField and a DBLJSEditField. However, PHP does not allow multiple inheritance, so I had to choose. I had chosen DBLSEditField to be this class' parent, mostly for educational reasons (show users how to derive a field from DBLJSEditField, which has different id and text value). This leads, unfortunatelly, to duplicating some functions :-(

Please, see DBLLCField for further information on lookup fields.

TODO example TODO

Located in /DBLJSLCField.php (line 35)

DBLField
   |
   --DBLJSEditField
      |
      --DBLJSLCField
Variable Summary
Method Summary
DBLJSLCField DBLJSLCField (string $name, mixed $title, string $titleHTML, int $width, string $editURL, DBLQuery &$query)
void acceptValue (mixed $value, mixed &$err, mixed &$r, mixed $new)
void addCondition (mixed $value, mixed &$r, mixed &$q)
void checkValue (mixed $value, mixed &$err, mixed &$r, mixed $new)
void formatDetail (mixed $value, mixed &$r)
void formatIndex (mixed $value, mixed &$r)
void getText (mixed $value, mixed &$r, mixed $dataSource)
void jsCheck (mixed $formName, mixed $new)
Variables
bool $checkValueFromPost (line 65)
  • var: Check that value from the POST (entered in the form) is in the list of allowed values got from a query. This prevents users 'cheating' posts to values they would not be allowed to enter. But requires database lookup and (currently) requires that DBLQuery class implements filtering. It if on (true) by default. May be turned off for performance reasons.
string $idDBName (line 70)
  • var: Name of the id field used in condition in value check. You may need to set it to 'table.id', if you are joining tables.
bool $indexDBConversion (line 77)
  • var: Convert vaues from indexes by DB, do not look for them in the $this->name."_txt" row field. This is several times slower and it prevents you from filtering by this field, but it let's you create simpler queries. Default is false.
string $noneID (line 53)
  • var: ID of the 'none' value (default is '0')
string $noneText (line 57)
  • var: Text of the none value (default is localized '<None>')
DBLQuery $query (line 49)
  • var: Query to get possible values (ids/texts) for this fields. The query must return a row containg (at least) two fields: 'id' which holds record ID and 'text' which holds record text. This usually requires DBLQuery to be able to do some kind of field aliasing.
string $referenceURL (line 42)
  • var: If set, the field textual value in index and record detail will be a hyperlink pointing to this URL. The field ID will be appended after this URL. See DBLLCField for discussion.

Redefinition of:
DBLField::$referenceURL

Inherited Variables

Inherited from DBLJSEditField

DBLJSEditField::$editURL
DBLJSEditField::$width

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::$titleHTML
DBLField::$titleTxt
DBLField::$widgetAttributes
Methods
Constructor DBLJSLCField (line 89)

Constructor.

DBLJSLCField DBLJSLCField (string $name, mixed $title, string $titleHTML, int $width, string $editURL, DBLQuery &$query)
  • string $name: Field name. See DBLField.
  • string $titleHTML: Field HTML title. See DBLField.
  • int $width: Width of the text field.
  • string $editURL: See editURL property.
  • DBLQuery $query: Query to get values. See query property.
acceptValue (line 208)
void acceptValue (mixed $value, mixed &$err, mixed &$r, mixed $new)

Redefinition of:
DBLJSEditField::acceptValue()
addCondition (line 199)
void addCondition (mixed $value, mixed &$r, mixed &$q)

Redefinition of:
DBLField::addCondition()
Add condition(s) to the query according to the filter value.
checkValue (line 161)
void checkValue (mixed $value, mixed &$err, mixed &$r, mixed $new)

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

Redefinition of:
DBLField::formatDetail()
Format field for record detail.
formatIndex (line 120)
void formatIndex (mixed $value, mixed &$r)

Redefinition of:
DBLField::formatIndex()
Format field for record index.
getText (line 105)
void getText (mixed $value, mixed &$r, mixed $dataSource)

Redefinition of:
DBLJSEditField::getText()
Internal - convert field id to text.
jsCheck (line 186)
void jsCheck (mixed $formName, mixed $new)

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

Inherited Methods

Inherited From DBLJSEditField

DBLJSEditField::DBLJSEditField()
DBLJSEditField::acceptValue()
DBLJSEditField::formatEdit()
DBLJSEditField::formatFilter()
DBLJSEditField::getText()

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:11 +0200 by phpDocumentor 1.2.3