1 package Reaction::UI::Widget::Field::Mutable::ChooseMany;
3 use Reaction::UI::WidgetClass;
5 use namespace::clean -except => [ qw(meta) ];
6 extends 'Reaction::UI::Widget::Field::Mutable';
10 implements fragment action_buttons {
12 qw(add_all_values do_add_values do_remove_values remove_all_values)
14 arg "event_id_${event}" => event_id $event;
18 implements fragment current_values {
19 my $current_choices = $_{viewport}->current_value_choices;
20 if( @$current_choices ){
21 arg field_name => event_id 'value';
22 render hidden_value => over $current_choices;
24 arg field_name => event_id 'no_current_value';
25 arg '_' => {value => 1};
26 render 'hidden_value';
30 implements fragment selected_values {
31 arg event_id_remove_values => event_id 'remove_values';
32 render value_option => over $_{viewport}->current_value_choices;
35 implements fragment available_values {
36 arg event_id_add_values => event_id 'add_values';
37 render value_option => over $_{viewport}->available_value_choices;
40 implements fragment value_option {
41 arg option_name => $_->{name};
42 arg option_value => $_->{value};
45 implements fragment hidden_value {
46 arg hidden_value => $_->{value};
49 __PACKAGE__->meta->make_immutable;
58 Reaction::UI::Widget::Field::ChooseMany
62 See L<Reaction::UI::Widget::Field>
64 This needs a refactor to not be tied to a dual select box, but ENOTIME
70 renders C<available_values>, C<action_buttons>, C<selected_values> and C<current_values>
74 renders the viewport's current_value_choices over hidden_value
78 C<content> is the value of the current choice
80 =head2 available_value
82 rendersthe viewport's current_available_value_choices over the option fragment
86 rendersthe viewport's current_selected_value_choices over the option fragment
90 C<content> is a dummy value but C<v_value> and C<v_name> are both set.
94 See L<Reaction::Class> for authors.
98 See L<Reaction::Class> for the license.