diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-31 12:53:07 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-31 12:53:07 +0000 |
commit | eb09f78b4b13f27599dfe9dee467e4731b29c6f0 (patch) | |
tree | f57c398855ecdf0aff278477ae6a218f87b87278 | |
parent | 2accb94e380d6e57bc2625ff5ad894f4bbbce72e (diff) | |
download | reaction-eb09f78b4b13f27599dfe9dee467e4731b29c6f0.tar.gz reaction-eb09f78b4b13f27599dfe9dee467e4731b29c6f0.zip |
tweaks for SearchableListViewContainer
-rw-r--r-- | lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm b/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm index b9f919d..a5696c9 100644 --- a/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm +++ b/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm @@ -5,6 +5,7 @@ use Reaction::Class; 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; @@ -14,18 +15,20 @@ use namespace::clean -except => 'meta'; 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? @@ -39,15 +42,13 @@ override BUILDARGS => sub { } }; 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', |