Packageindex Classtrees Modulegroups Elementlist Report XML Files
 
File: c:/www/apache/doc2//form/form_element_combo.inc
PHPLib Form Rewrite 11.02.2001 - Form

form_element_combo

form_commonobject
   |
  +-- form_element
     |
    +-- form_element_selectobject
       |
      +-- form_element_combo

Generates a new metatype combo box

 

private class form_element_combo extends form_element_selectobject

Generates a new metatype combo box

AuthorsUlf Wendel <uw@netuse.de>
Version$Id: form_element_combo.inc,v 1.11 2001/01/10 00:22:52 uw Exp $

 

Methods inherited from form_element_selectobject

setoptions, isselected, setvalue, validateintro, getintrooptiontags, getoptiontags, getfrozen

Methods inherited from form_element

form_element, setup, checkconfiguration, getvalue, gettype, isbutton, getvalidator, setvalidator, freeze, unfreeze, thawout, getfrozen, show, validatelength, validateregex, dovalidation, react, setvalue, getjsonactivation, getcommonhtmlattributes, getfrozenhiddenelement, getfrozentable, getjs, getname, ishidden

Methods inherited from form_commonobject

introspection

Public Method Summary

boolean

addOption(string $label, [ mixed $value ])

Adds a new option to the option list.

Private Method Summary

boolean

validateTextInputEntry()

Validates the value of the text input field ( = new combo option )
string

getNewComboOption()

Returns the new combo option entry.
void

sortOptions()

Sorts the option list if sort is not equal "top" and cares on sort_icase.
array

sortOptionList(array $options)

Sorts an array.
void

get([ string $subelement ])

Returns the HTML code of the element.Warning: documentation is missing.
void

getExtraJS()

Returns additional JavaScript required by some complex form elements.Warning: documentation is missing.
void

form_combo_add()

Warning: documentation is missing.
void

getJSValue()

JavaScript function used to get the value of the element.Warning: documentation is missing.
void

validate()

Returns the result of the (serverside) validation.Warning: documentation is missing.

Fields inherited from form_element_selectobject

$size, $intro, $intro_e, $seperators, $seperators_e, $options, $accesskey, $tabindex, $required_fields

Fields inherited from form_element

$flag_config_ok, $elname, $name, $value, $additional_html, $frozen, $class, $id, $style, $shared_required_fields, $required_fields, $shared_optional_fields, $method, $val_events, $js_mode, $form_name, $validator, $js_validator

Fields inherited from form_commonobject

$cr_html, $cr_js, $exception

Private Field Summary

integer

$inputsize

HTML size attribute of the text input field.
integer

$minlength

Minimal length of the text input field value ( = new combo option ).
integer

$maxlength

HTML maxlength attribute of the text input field ( = new combo option ).
string

$length_e

Error message if the length of the text input field ( = new combo option ) is incorrect.
string

$valid_regex

RegExp used to validate the text input field ( = new combo option ).
boolean

$valid_icase

Case insensitive validation?
string

$valid_e

Error message of RegExp errors.
boolean

$readonly

HTML readonly attribute of the text input field.
string

$sort

Where will new options appear in the select box?
boolean

$sort_icase

Sort case insensitive?
string

$add

Caption of the add option button.
array

$optional_fields

List of optional fields provided by a derived class.

Public Method Details

addOption

public boolean addOption( string $label, [ mixed $value ] )

  Adds a new option to the option list.
Combo boxes are a little complicated. You have to do thesession handling of new options in your scripts. Usethis function to add a new option to the option list.See the examples for further instructions.

Parameter
string $label
mixed $value = >>""<<
Returns boolean

Throws form_error
See Also getNewComboOption()

Private Method Details

validateTextInputEntry

private boolean validateTextInputEntry( )

  Validates the value of the text input field ( = new combo option )

Returns boolean $error

array [0] = $ok, $error[1] = $messages

See Also getNewComboOption(), validate()

getNewComboOption

private string getNewComboOption( )

  Returns the new combo option entry.

Returns string

If there's no valid entry an empty string is returned.

See Also validateTextInputEntry()

sortOptions

private void sortOptions( )

  Sorts the option list if sort is not equal "top" and cares on sort_icase.

Returns void


sortOptionList

private array sortOptionList( array $options )

  Sorts an array.

Parameter
array $options
Returns array


get

private void get( [ string $subelement ] )

  Returns the HTML code of the element.

Warning: documentation is missing.

Parameter
string $subelement = >>""<<
Some complex form elements consists of several
HTML form elements. Date e.g. uses several select boxes.
The subelement name allows you to retrive each of this
"subelements". To get the year selector of a "Ymd"
date element you would use the "Y" as a subelement name.
Returns void

See Also getfrozen(), show()

getExtraJS

private void getExtraJS( )

  Returns additional JavaScript required by some complex form elements.
Some elements need extra JavaScript functionality to befull featured. Date for example is able to draw a "now" button. When theuser clicks this button, the date selectors change their values to thecurrent date. An additional JavaScript function "form_date_now" handles the clickon the button.The function returns the JavaScript code itself and a name for the codesnippet that allows the form object to avoid sending the code twice.

Warning: documentation is missing.

Returns void


form_combo_add

private void form_combo_add( )

 

Warning: documentation is missing.

Returns void


getJSValue

private void getJSValue( )

  JavaScript function used to get the value of the element.
Most elements can use document.forms[..].elements[...].value to get thevalue of an element but some need a more sophisticated function. Theseelements must override this function.The JavaScript function provided by this elements should be names "form_elmenttype",e.g. "form_select". The (JS) function gets called with two arguments:string formname, string elementname. It returns the value of the element, seeform_element_select for an example.The function returns the JavaScript code itself and a name for the codesnippet that allows the form object to avoid sending the code twice.

Warning: documentation is missing.

Returns void


validate

private void validate( )

  Returns the result of the (serverside) validation.

Warning: documentation is missing.

Returns void

See Also validateLength(), validateRegEx(), doValidation()

Private Field Details

$inputsize

private integer $inputsize

>>-1<<

HTML size attribute of the text input field.


$minlength

private integer $minlength

>><<

Minimal length of the text input field value ( = new combo option ).

See Also $maxlength, $length_e

$maxlength

private integer $maxlength

>>-1<<

HTML maxlength attribute of the text input field ( = new combo option ).
The attribute is not only use as HTML attribute but also by validate().

See Also $minlength, $length_e

$length_e

private string $length_e

>>""<<

Error message if the length of the text input field ( = new combo option ) is incorrect.
This error message will appear when the value of thetext input field is out of the range defined by minlength undmaxlength.

See Also $minlength, $maxlength

$valid_regex

private string $valid_regex

>>""<<

RegExp used to validate the text input field ( = new combo option ).

See Also $valid_icase, $valid_e

$valid_icase

private boolean $valid_icase

>>false<<

Case insensitive validation?

See Also $valid_regex, $valid_e

$valid_e

private string $valid_e

>>""<<

Error message of RegExp errors.
Note that you have to set $valid_regex if you want some validation...

See Also $valid_regex, $valid_icase

$readonly

private boolean $readonly

>>false<<

HTML readonly attribute of the text input field.
Doesn't really make sense - will probably disappear.


$sort

private string $sort

>>"top"<<

Where will new options appear in the select box?
You can choose where new options will appear in theselect box. By default they will appear at the topbut you can choose to sort them in alphabetical orderor reverse alphabetical order eighter.

See Also $sort_icase

$sort_icase

private boolean $sort_icase

>>true<<

Sort case insensitive?

See Also $sort

$add

private string $add

>>""<<

Caption of the add option button.
If the add attribute is set and the form has a JavaScript namethe combo element will consist of three elements: a select box,a text input field and a "add option" button.


$optional_fields

private array $optional_fields

>>array ( "size" => "integer", "intro" => "mixed", "intro_e" => "string", "seperators" => "array", "seperators_e" => "string", "accesskey" => "string", "tabindex" => "integer", "inputsize" => "integer", "minlength" => "integer", "maxlength" => "integer", "length_e" => "string", "valid_regex" => "string", "valid_icase" => "boolean", "valid_e" => "string", "readonly" => "boolean", "sort" => "string", "add" => "string" )<<

List of optional fields provided by a derived class.

See Also $shared_optional_fields, $required_fields


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta