use Reaction::UI::WidgetClass;
class ActionForm, which {
- widget renders [ qw/header fields buttons footer/ ],
- {id => sub { $_{viewport}->location } };
+ fragment widget [ qw/header field_list buttons footer/ ];
- fields renders [field over func('viewport','ordered_fields')];
- field renders [ 'viewport' ];
+ fragment field_list [field over func('viewport','ordered_fields')];
+ fragment field [ 'viewport' ];
#move button logic here
- buttons renders [ string {"DUMMY"} ],
+ fragment buttons [ string {"DUMMY"} ],
- {message => sub{ $_{viewport}->can('message') ? $_{viewport}->message : "" } };
+ { message => sub{ $_{viewport}->can('message') ? $_{viewport}->message : "" },
+ ok_label => func(viewport => 'ok_label'),
+ close_label => func(viewport => 'close_label'),
+ apply_label => func(viewport => 'apply_label'),
+ };
+
- header renders [ string {"DUMMY"} ];
- footer renders [ string {"DUMMY"} ];
+ fragment header [ string {"DUMMY"} ];
+ fragment footer [ string {"DUMMY"} ];
};
has id => (isa => 'Str', is => 'ro', lazy_build => 1);
has name => (isa => 'Str', is => 'ro', lazy_build => 1);
- implements build_id => as { shift->viewport->event_id_for('value'); };
- implements build_name => as { shift->viewport->event_id_for('value'); };
+ implements _build_id => as { shift->viewport->event_id_for('value'); };
+ implements _build_name => as { shift->viewport->event_id_for('value'); };
- widget renders [qw/label field message/
+ fragment widget [qw/label field message/
=> { id => func('self', 'id'),
name => func('self', 'name'), }
];
class ChooseOne is 'Reaction::UI::Widget::Field', which {
- field renders [ option over func('viewport', 'value_choices') ],
+ fragment field [ option over func('viewport', 'value_choices') ],
- { is_required => sub{ $_{viewport}->attribute->required } };
+ { is_required => sub{ $_{viewport}->attribute->is_required } };
- option renders [string {"DUMMY"}],
+ fragment option [string {"DUMMY"}],
{
v_value => sub { $_->{value} },
v_name => sub { $_->{name} },