NAME
HTML::Widget::DBIC - a subclass of HTML::Widgets for dealing with DBIx::Class
SYNOPSIS
use HTML::Widget::DBIC;
# create a widget coupled with a db record
my $widget = HTML::Widget::DBIC->create_from_config( $config, $resultset, $item );
# process a query
my $result = $widget->process ( $query );
# and save the values from the query to the database
$result->save_to_db();
METHODS
- create_from_config
-
Method to create widget. The parameters are configuration for all the widget fields, a DBIC Resultset and optionally a DBIC record (item) - to fill in the current values in the form and as the target for saving the data, if not present when saving a new record will be created.
The config is a reference to a list of configuration for particular fields. Like: my $config = [ { 'foreign_class' => 'Dvd', 'widget_element' => [ 'Select', 'multiple' => 1 ], 'name' => 'dvds', 'label' => 'Dvds', 'bridge_rel' => 'dvdtags' }, { 'widget_element' => [ 'Textarea', 'rows' => 5, 'cols' => 60 ], 'constraints' => [ { 'max' => '255', 'constraint' => 'Length', 'message' => 'Should be shorten than 255 characters' }, { 'constraint' => 'All', 'message' => 'The field is required' } ], 'name' => 'name', 'label' => 'Name' }, { 'primary_key' => 1, 'name' => 'id', 'label' => 'Id' } ];
- process
-
Like HTML::Widget->process but produces HTML::Widget::Result::DBIC (instead of HTML::Widget::Result) - with extra info for saving to database.
- save_to_db
-
HTML::Widget::DBIC::Result method to save the data from widget to the database
DIAGNOSTICS
Error message here, perhaps with %s placeholders
-
[Description of error here]
Another error message here
-
[Description of error here]
[Et cetera, et cetera]
CONFIGURATION AND ENVIRONMENT
Catalyst::Helper::Controller::InstantCRUD requires no configuration files or environment variables.
DEPENDENCIES
None.
INCOMPATIBILITIES
None reported.
BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests to bug-catalyst-helper-controller-instantcrud@rt.cpan.org
, or through the web interface at http://rt.cpan.org.
AUTHOR
<Zbigniew Lukasiak> <<zz bb yy @ gmail.com>>
LICENCE AND COPYRIGHT
Copyright (c) 2005, <Zbigniew Lukasiak> <<zz bb yy @ gmail.com>>
. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
1; # Magic true value required at end of module __END__