Packageindex Classtrees Modulegroups Elementlist Report XML Files
 
File: c:/www/apache/doc2//form/form_element_combo.inc
PHPLib Form Rewrite 2001/03/01 - 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.5 2000/12/12 01:37:36 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, getjsvalue, getextrajs, 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 $value ])

Returns the HTML code 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, $exceptions

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?
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 $value ] )

  Returns the HTML code of the element.

Warning: documentation is missing.

Parameter
string $value = >>""<<
The value is only used with radio buttons.
If the given value is equal to the value of the
element when it was defined, the radio gets selected.
Returns void

See Also getfrozen(), show()

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

$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" )<<

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