use Reaction::UI::WidgetClass;
class ActionForm, which {
- widget renders [qw/header fields buttons footer/
- => { viewport => func('self','viewport') } ];
+ fragment widget [ qw/header field_list buttons footer/ ];
- fields renders [viewport over func('self','ordered_fields')];
+ fragment field_list [field => over func('viewport','ordered_fields')];
+ fragment field [ 'viewport' ];
- buttons renders [ string {"DUMMY"} ], {message => func('viewport','message');
- header renders [ string {"DUMMY"} ];
- footer renders [ string {"DUMMY"} ];
+ #move button logic here
+ fragment buttons [ string {"DUMMY"} ],
+ {message => sub{ $_{viewport}->can('message') ? $_{viewport}->message : "" } };
+ fragment header [ string {"DUMMY"} ];
+ fragment footer [ string {"DUMMY"} ];
};
__END__;
-=for layout widget
+=head1 NAME
- <form action="" method="post" enctype="multipart/form-data">
- [% header %]
- [% fields %]
- [% buttons %]
- [% footer %]
- </form>
+Reaction::UI::Widget::ActionForm
-=for layout header
+=head1 DESCRIPTION
-<h2>Le Header</h2>
+=head1 FRAGMENTS
-=for layout fields
+=head2 widget
-[% content %] <br />
+Additional variables available in topic hash: "viewport".
-=for layout buttons
+Renders "header", "field_list", "buttons" and "footer"
- [% IF message; %]
- <span>[% message %]</span> <br />
- [% END; %]
+=head2 field_list
- [% allowed_events = viewport.accept_events; %]
- [% IF allowed_events.grep('^ok$').size; %]
- <input type="submit" name="[% viewport.event_id_for('ok') | html%]" value="ok" />
- [% END; %]
+Sequentially renders the C<ordered_fields> of the viewport
- [% IF (viewport.ordered_fields.size != 0) && allowed_events.grep('^apply$').size; %]
- <input type="submit" name="[% viewport.event_id_for('apply') | html%]" value="apply" />
- [% END; %]
+=head2 buttons
- [% IF allowed_events.grep('^close$').size; %]
- <input type="submit" name="[% viewport.event_id_for('close') | html%]" value="cancel" />
- [% END; %]
- <br />
+Additional variables available in topic hash: "message"
-=for layout footer
+=head2 header
- <h2>Le Footer</h2>
+Content is a dummy value
+
+=head2 footer
+
+Content is a dummy value
+
+=head1 AUTHORS
+
+See L<Reaction::Class> for authors.
+
+=head1 LICENSE
+
+See L<Reaction::Class> for the license.
=cut
+