Reaction::UI::Controller::Role::Action::Delete - Delete action
Provides a "delete" action, which sets up an
Action Viewport by calling "action_for" on
the object located in the "object" slot of
the "stash".
package MyApp::Controller::Foo;
use base 'Reaction::Controller';
use Reaction::Class;
with(
'Reaction::UI::Controller::Role::GetCollection',
'Reaction::UI::Controller::Role::Action::Simple',
'Reaction::UI::Controller::Role::Action::Object',
'Reaction::UI::Controller::Role::Action::Delete'
);
__PACKAGE__->config( action => {
object => { Chained => 'base' },
delete => { Chained => 'object' },
} );
sub base :Chained('/base') :CaptureArgs(0) {
...
}
sub on_delete_apply_callback{ #optional callback
my($self, $c, $vp, $result) = @_;
...
}
sub on_delete_close_callback{ #optional callback
my($self, $c, $vp) = @_;
...
}
This role also consumes the following roles:
- Reaction::UI::Controller::Role::Action::Simple
The following methods must be provided by the consuming class:
- "make_context_closure"
Chain endpoint with no args, sets up the viewport with the appropriate action.
If the methods "on_delete_apply_callback"
and "on_delete_close_callback" are present
in the consuming class, they will be used as callbacks in the viewport.
Extends to set the "delete" key in the map to
Reaction::UI::ViewPort::Action
- Reaction::UI::Controller
- Reaction::UI::Controller::Role::GetCollection
- Reaction::UI::Controller::Role::Action::Simple
- Reaction::UI::Controller::Role::Action::List
- Reaction::UI::Controller::Role::Action::View
- Reaction::UI::Controller::Role::Action::Object
- Reaction::UI::Controller::Role::Action::Create
- Reaction::UI::Controller::Role::Action::Update
- Reaction::UI::Controller::Role::Action::DeleteAll
See Reaction::Class for authors.
See Reaction::Class for the license.
Hey! The above document had some coding errors, which are explained
below:
- Around line 83:
- Unknown directive: =over4
- Around line 85:
- '=item' outside of any '=over'
- Around line 93:
- Unknown directive: =over4
- Around line 95:
- '=item' outside of any '=over'
- Around line 115:
- Unknown directive: =over4
- Around line 117:
- '=item' outside of any '=over'