Reaction::UI::ViewPort::Object - Display an InterfaceModel::Object
use aliased 'Reaction::UI::ViewPort::Object'; ... $controller->push_viewport(Object, model => $person_interface_model_object, fields_order => [qw( firstname lastname )], excluded_fields => [qw( password )], );
Takes a Reaction::InterfaceModel::Object class and displays the configured fields.
Required Reaction::InterfaceModel::Object.
Initialised via "_build_fields"
Hash reference keyed by field names. Values are hash references containing arguments to the field builder method of the attribute.
Array reference of strings defining the order of all fields (including the ones that might be excluded).
Hash reference containing resolved builder method names per field. Utilised by "_build_fields"
Array reference of strings naming fields to exclude from the interface.
List of field names to include. If both included_fields and excluded_fields are specified the result is those fields which are in included_fields and not in excluded_fields.
included_fields
excluded_fields
Array reference of strings Initialised by the "_computed_field_order" method. Contains the fields to show in the correct order.
Array reference populated by "_build_containers".
Array reference containing container layout specifications.
These methods, although stable, are subject to change without notice. These are meant to be used only by developers. End users should refrain from using these methods to avoid potential breakages.
Takes the value of the Field constructor argument, if true, and sets it as the new "field_args" hash reference.
Field
Takes an attribute object as argument and returns a string containing the name of the method that builds the fields for this attribute.
If the viewport implements it, _build_fields_for_name_${attr_name} will be used.
_build_fields_for_name_${attr_name}
If that is not available, it will take the isa information of the type constraint and see if it is a loaded class implementing meta. If it is, every class in its class_precedence_list will be taken and used to try to find a _build_fields_for_type_${mangled_class_name} method on the viewport.
isa
meta
class_precedence_list
_build_fields_for_type_${mangled_class_name}
"mangled" means here that every :* will be replaced with _. For example: Foo::Bar would become Foo_Bar.
:*
_
Foo::Bar
Foo_Bar
If the isa information was not obtainable or no fitting method was found, it will try the type name in a method named _build_fields_for_type_${mangled_type_name}.
_build_fields_for_type_${mangled_type_name}
If could be found on this constraint, it will make the same attempts to find a method on its parent type constraint.
This method will die if it can't locate a method to build a field for this attribute.
Uses "container_layouts" to build a list of Reaction::UI::ViewPort::Field::Container objects.
Takes the "model"s parameter_attributes to build fields via "get_builder_for". They will be ordered as specified in "computed_field_order".
parameter_attributes
Takes the names of the "model"s parameter_attributes' reader methods and assumes them as field names. Then it uses "field_order" and "excluded_fields" to calculate the order of all included fields and returns those names.
$self->_build_simple_field( attribute => $attribute_object, class => $field_class, %field_attrs, );
Takes an attribute meta object, a field class (a Reaction::UI::ViewPort::Field subclass) and an additional set of arguments to pass to the field constructor and returns the new field. Field classes themselves are Reaction::UI::ViewPort subclasses.
Text, Number, Integer, Boolean, String, DateTime, RelatedObject, Array, Collection, File, Container
See Reaction::Class for authors.
See Reaction::Class for the license.
To install Reaction, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Reaction
CPAN shell
perl -MCPAN -e shell install Reaction
For more information on module installation, please visit the detailed CPAN module installation guide.