Commit | Line | Data |
---|---|---|
8f19d042 | 1 | package Reaction::UI::Widget::Field::ChooseMany; |
2 | ||
3 | use Reaction::UI::WidgetClass; | |
4 | ||
5 | class ChooseMany is 'Reaction::UI::Widget::Field', which { | |
6 | ||
664d660c | 7 | implements fragment action_buttons { |
8 | foreach my $event ( | |
9 | qw(add_all_values do_add_values do_remove_values remove_all_values) | |
10 | ) { | |
11 | arg "event_id_${event}" => event_id $event; | |
12 | } | |
13 | }; | |
14 | ||
15 | implements fragment current_values { | |
16 | render hidden_value => over $_{viewport}->current_value_choices; | |
17 | }; | |
18 | ||
19 | implements fragment selected_values { | |
20 | arg event_id_remove_values => event_id 'remove_values'; | |
21 | render value_option => over $_{viewport}->current_value_choices; | |
22 | }; | |
23 | ||
24 | implements fragment available_values { | |
25 | arg event_id_add_values => event_id 'add_values'; | |
26 | render value_option => over $_{viewport}->available_value_choices; | |
27 | }; | |
28 | ||
29 | implements fragment value_option { | |
30 | arg option_name => $_->{name}; | |
31 | arg option_value => $_->{value}; | |
32 | }; | |
33 | ||
34 | implements fragment hidden_value { | |
35 | arg hidden_value => $_->{value}; | |
36 | }; | |
9de685fc | 37 | |
8f19d042 | 38 | }; |
39 | ||
40 | 1; | |
41 | ||
6ab43711 | 42 | __END__; |
8f19d042 | 43 | |
5a1a893e | 44 | =head1 NAME |
8f19d042 | 45 | |
5a1a893e | 46 | Reaction::UI::Widget::Field::ChooseMany |
8f19d042 | 47 | |
5a1a893e | 48 | =head1 DESCRIPTION |
8f19d042 | 49 | |
5a1a893e | 50 | See L<Reaction::UI::Widget::Field> |
9de685fc | 51 | |
5a1a893e | 52 | This needs a refactor to not be tied to a dual select box, but ENOTIME |
9de685fc | 53 | |
5a1a893e | 54 | =head1 FRAGMENTS |
9de685fc | 55 | |
5a1a893e | 56 | =head2 field |
9de685fc | 57 | |
5a1a893e | 58 | renders C<available_values>, C<action_buttons>, C<selected_values> and C<current_values> |
9de685fc | 59 | |
5a1a893e | 60 | =head2 current values |
9de685fc | 61 | |
5a1a893e | 62 | renders the viewport's current_value_choices over hidden_value |
9de685fc | 63 | |
5a1a893e | 64 | =head2 hidden_value |
9de685fc | 65 | |
5a1a893e | 66 | C<content> is the value of the current choice |
9de685fc | 67 | |
5a1a893e | 68 | =head2 available_value |
9de685fc | 69 | |
5a1a893e | 70 | rendersthe viewport's current_available_value_choices over the option fragment |
9de685fc | 71 | |
5a1a893e | 72 | =head2 selected_value |
9de685fc | 73 | |
5a1a893e | 74 | rendersthe viewport's current_selected_value_choices over the option fragment |
8f19d042 | 75 | |
5a1a893e | 76 | =head2 option |
8f19d042 | 77 | |
5a1a893e | 78 | C<content> is a dummy value but C<v_value> and C<v_name> are both set. |
8f19d042 | 79 | |
5a1a893e | 80 | =head1 AUTHORS |
8f19d042 | 81 | |
5a1a893e | 82 | See L<Reaction::Class> for authors. |
83 | ||
84 | =head1 LICENSE | |
85 | ||
86 | See L<Reaction::Class> for the license. | |
8f19d042 | 87 | |
88 | =cut |