IInput

From FiFormsWiki

Jump to: navigation, search

class iInput

An abstract class for data bound inputs class from which other inputs are derived

Contents

Properties

$caption caption displayed on form
$currentRec current record of dataset
$dbField database field control is bound to, or other for a non data-bound control
$error Set to true if an error resulted in validating data.
$errorMsg Any error message returned as a result of data validation.
$formatStr the string "template" for the output of the controls. Variable names enclosed in %% symbols will be replaced by class variables of the same name.
$formatStrRO used as $formatStr if $readOnly==TRUE
$otherTags Place to insert additional property tags
$readOnly Specifies whether this control should be updateable
$section section of form this control appears in
$value value retreived from database
$valueToSave Value retreived from POST to be committed to database, if matching %db Field% is found in table

Method Summary

checkRO

Checks if $readOnly is true, and sets the formatStr accordingly

drawInput

Returns the HTML representation of this iInput.

getValueToSave

Retreives a value from _POST with the key matching dbField. This can be overridden in child classes to do any processing necessary before the value is committed to the database.

hide

Effectively hides the control, so no output is returned by drawInput()

iInput

A generic constructor, designed to be called by child classes.

throwError

Flags an error on saving data to the database.

Method Detail

checkRO

Checks if $readOnly is true, and sets the formatStr accordingly

Syntax: checkRO()

Returns

N/A


drawInput

Returns the HTML representation of this iInput.

Syntax: drawInput()

Returns

A string of HTML representing the iInput.


getValueToSave

Retreives a value from _POST with the key matching dbField. This can be overridden in child classes to do any processing necessary before the value is committed to the database.

Syntax: getValueToSave()

Returns

TRUE if value was retreived successfully, FALSE otherwise.


hide

Effectively hides the control, so no output is returned by drawInput()

Syntax: hide()


Returns

N/A


iInput

A generic constructor, designed to be called by child classes.

Syntax: iInput($theArgs)

Parameters

$theArgs - An array of options to set the properties of iInput: 1=>dbField, 2=>caption. This is designed so child classes can call "new iInput(func_get_args()" and pass the arguments from the child constructor to the parent.

Returns

a new iInput object


throwError

Flags an error on saving data to the database.

Syntax: throwError($errorMessage)


Parameters

$errorMessage - A short description of the error to be displayed to the user

Returns

N/A

Personal tools