class ChooseOne is 'Reaction::UI::Widget::Field', which {
- field renders [ option over func('viewport', 'value_choices') ],
- { is_required => sub{ $_{viewport}->attribute->is_required } };
-
- option renders [string {"DUMMY"}],
- {
- v_value => sub { $_->{value} },
- v_name => sub { $_->{name} },
- is_selected => sub { $_{viewport}->is_current_value($_->{value}) },
- };
+ implements fragment option_is_required {
- if ($_{viewport}->attribute->required) {
++ if ($_{viewport}->attribute->is_required) {
+ render 'options_is_required_yes';
+ } else {
+ render 'options_is_required_no';
+ }
+ };
+
+ implements fragment option_list {
+ render option => over $_{viewport}->value_choices;
+ };
+
+ implements fragment option {
+ arg option_name => $_->{name};
+ arg option_value => $_->{value};
+ };
+
+ implements fragment option_is_selected {
+ if ($_{viewport}->is_current_value($_->{value})) {
+ render 'option_is_selected_yes';
+ } else {
+ render 'option_is_selected_no';
+ }
+ };
};