Alpha Framework 4.0.0 API Documentation

RecordSelector
in package

Record selection HTML widget.

Tags
since
1.0
author

John Collins dev@alphaframework.org

license

http://www.opensource.org/licenses/bsd-license.php The BSD License

copyright

Copyright (c) 2021, John Collins (founder of Alpha Framework). All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

* Redistributions of source code must retain the above
  copyright notice, this list of conditions and the
  following disclaimer.
* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the
  following disclaimer in the documentation and/or other
  materials provided with the distribution.
* Neither the name of the Alpha Framework nor the names
  of its contributors may be used to endorse or promote
  products derived from this software without specific
  prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Table of Contents

Properties

$accessingClassName  : string
Used to indicate the reading side when accessing from MANY-TO-MANY relation (leave blank for other relation types).
$label  : string
The label text to use where required.
$logger  : Logger
Trace logger.
$name  : string
The name of the HTML input box for storing the hidden and display values.
$onloadJS  : string
Javascript to run when the widget opens in a new window.
$relationObject  : Relation
The relation object that we are going to render a view for.

Methods

__construct()  : mixed
The constructor.
render()  : string
Renders the text boxes and buttons for the widget, that will appear in user forms.
renderSelector()  : string
Returns the HTML for the record selector that will appear in a pop-up window.

Properties

$accessingClassName

Used to indicate the reading side when accessing from MANY-TO-MANY relation (leave blank for other relation types).

private string $accessingClassName
Tags
since
1.0

$label

The label text to use where required.

private string $label
Tags
since
1.0

$name

The name of the HTML input box for storing the hidden and display values.

private string $name
Tags
since
1.0

$onloadJS

Javascript to run when the widget opens in a new window.

private string $onloadJS = ''
Tags
since
1.0

$relationObject

The relation object that we are going to render a view for.

private Relation $relationObject = null
Tags
since
1.0

Methods

__construct()

The constructor.

public __construct(Relation $relation[, string $label = '' ][, string $name = '' ][, string $accessingClassName = '' ]) : mixed
Parameters
$relation : Relation
$label : string = ''
$name : string = ''
$accessingClassName : string = ''
Tags
since
1.0
throws
IllegalArguementException

render()

Renders the text boxes and buttons for the widget, that will appear in user forms.

public render([bool $expanded = false ][, bool $buttons = true ]) : string
Parameters
$expanded : bool = false

Render the related fields in expanded format or not (optional)

$buttons : bool = true

Render buttons for expanding/contacting the related fields (optional)

Tags
since
1.0
Return values
string

renderSelector()

Returns the HTML for the record selector that will appear in a pop-up window.

public renderSelector(string $fieldname[, array<string|int, mixed> $lookupIDs = array() ]) : string
Parameters
$fieldname : string

The hidden HTML form field in the parent to pass values back to.

$lookupIDs : array<string|int, mixed> = array()

An optional array of related look-up IDs, only required for rendering MANY-TO-MANY rels

Tags
since
1.0
Return values
string

        
On this page

Search results