use aliased 'Reaction::InterfaceModel::Action::Search::UpdateSpec', 'UpdateSearchSpec';
use aliased 'Reaction::UI::ViewPort::ListViewWithSearch';
use aliased 'Reaction::UI::ViewPort::Action' => 'ActionVP';
+use aliased 'Reaction::UI::ViewPort';
use aliased 'Reaction::UI::ViewPort::Collection::Role::Pager', 'PagerRole';
use Method::Signatures::Simple;
extends 'Reaction::UI::ViewPort';
has 'listview' => (
- isa => ListViewWithSearch,
+ isa => ViewPort,
is => 'ro',
required => 1,
);
-has 'search_form' => (isa => ActionVP, is => 'ro', required => 1);
+has 'search_form' => (isa => ViewPort, is => 'ro', required => 1);
override BUILDARGS => sub {
my $args = super;
my $spec_event_id = $args->{location}.':search-spec';
my $spec_class = $args->{spec_class}
or confess "Argument spec_class is required";
+ my $listview_class = $args->{'listview_class'} || ListViewWithSearch;
+ my $search_form_class = $args->{'search_form_class'} || ActionVP;
my $action_class = $args->{action_class}
or confess "Argument action_class is required";
# TODO: how do we autodiscover spec classes?
}
};
my $listview_location = $args->{location}.'-listview';
- # should this maybe use the listview class in $args->{listview}?
- my $listview = $args->{listview} = ListViewWithSearch->new(
+ my $listview = $args->{listview} = $listview_class->new(
%$args,
- layout => 'list_view',
+ layout => $args->{'listview_layout'} || 'list_view',
search_spec => $spec,
location => $listview_location,
);
- # same as with listview wrt. class name
- $args->{search_form} = ActionVP->new(
+ $args->{search_form} = $search_form_class->new(
model => $action_class->new(target_model => $spec),
location => $args->{location}.'-search_form',
apply_label => 'search',