![]() |
![]()
| ![]() |
![]()
NAMEReaction::UI::ViewPort::Object - Display an InterfaceModel::ObjectSYNOPSISuse aliased 'Reaction::UI::ViewPort::Object'; ... $controller->push_viewport(Object, model => $person_interface_model_object, fields_order => [qw( firstname lastname )], excluded_fields => [qw( password )], ); DESCRIPTIONTakes a Reaction::InterfaceModel::Object class and displays the configured fields.ATTRIBUTESmodelRequired Reaction::InterfaceModel::Object.fieldsInitialised via "_build_fields"field_argsHash reference keyed by field names. Values are hash references containing arguments to the field builder method of the attribute.field_orderArray reference of strings defining the order of all fields (including the ones that might be excluded).builder_cacheHash reference containing resolved builder method names per field. Utilised by "_build_fields"excluded_fieldsArray reference of strings naming fields to exclude from the interface.included_fieldsList 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".computed_field_orderArray reference of strings Initialised by the "_computed_field_order" method. Contains the fields to show in the correct order.containersArray reference populated by "_build_containers".container_layoutsArray reference containing container layout specifications.INTERNAL METHODSThese 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.BUILDTakes the value of the "Field" constructor argument, if true, and sets it as the new "field_args" hash reference.get_builder_forTakes 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. 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. "mangled" means here that every ":*" will be replaced with "_". For example: "Foo::Bar" would become "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}". 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. _build_containersUses "container_layouts" to build a list of Reaction::UI::ViewPort::Field::Container objects._build_fieldsTakes the "model"s "parameter_attributes" to build fields via "get_builder_for". They will be ordered as specified in "computed_field_order"._build_computed_field_orderTakes 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._build_simple_field$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. _build_fields_for_type_Num_build_fields_for_type_Int_build_fields_for_type_Bool_build_fields_for_type_Password_build_fields_for_type_Str_build_fields_for_type_SimpleStr_build_fields_for_type_DateTime_build_fields_for_type_Enum_build_fields_for_type_ArrayRef_build_fields_for_type_Reaction_InterfaceModel_Object_build_fields_for_type_Reaction_InterfaceModel_CollectionFIELD TYPESText, Number, Integer, Boolean, String, DateTime, RelatedObject, Array, Collection, File, ContainerAUTHORSSee Reaction::Class for authors.LICENSESee Reaction::Class for the license.
|