[Catalyst] Catalyst::Controller::FormBuilder
Hi, I want to create a form with some fields which are displayed only if some conditions are met. Can I do this using Catalyst::Controller::FormBuilder, or in this case I need to create/print the forms manually? For example, I want to print a form for editing the fields in a record from a database, and if a file was uploaded previously, the form should also print a set of 2 radio buttons: keep the previously uploaded file, and upload the new file. Thanks. Octavian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Controller::FormBuilder
On Mon, Apr 30, 2007 at 11:45:15AM +0300, Octavian Rasnita wrote: Hi, I want to create a form with some fields which are displayed only if some conditions are met. Can I do this using Catalyst::Controller::FormBuilder, or in this case I need to create/print the forms manually? Yes. Check out the documentation for FormBuilder: http://www.formbuilder.org/download/CGI-FormBuilder-3.0501/docs/CGI/FormBuilder.html You can just use the form object directly, and add your fields manually in the controller. (As opposed to loading it from a YAML file) Adam -- HJK Solutions - We Launch Startups - http://www.hjksolutions.com Adam Jacob, Senior Partner T: (206) 508-4759 E: [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Controller::FormBuilder config problem
On 21 Dec 2006, at 18:05, Michael Reece wrote: be wary of putting your base controller class in the MyApp/ Controller/ directory, because catalyst will load it as a controller itself. which sucks if you want to put default inheritable actions in your base class. i use MyApp/Controller.pm for the base class to avoid this problem, since catalyst still, as far as i can tell, has no way to let you specify which controller classes to load or not load. Then you didn't read the docs on setup_components in Catalyst.pm Personally I tend to use MyApp/ControllerBase/*.pm to disambiguate anyway. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Controller::FormBuilder config problem
On Jan 2, 2007, at 7:28 AM, Matt S Trout wrote: On 21 Dec 2006, at 18:05, Michael Reece wrote: be wary of putting your base controller class in the MyApp/ Controller/ directory, because catalyst will load it as a controller itself. which sucks if you want to put default inheritable actions in your base class. i use MyApp/Controller.pm for the base class to avoid this problem, since catalyst still, as far as i can tell, has no way to let you specify which controller classes to load or not load. Then you didn't read the docs on setup_components in Catalyst.pm aha, it looks like Module::Pluggable was made more useful last april or so. thanks for the pointer. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Controller::FormBuilder config problem
On 2 Jan 2007, at 17:30, Michael Reece wrote: aha, it looks like Module::Pluggable was made more useful last april or so. thanks for the pointer. Actually, we were using Module::Pluggable::Fast until 5.70. However muttley was kind enough to help us get rid of that horrific piece of shit by adding the additional features Catalyst required to port onto Module::Pluggable itself and we added some extra configurability while we were there (props to Brian Cassidy for doing most of the legwork on this one while I hung around in IRC and kibitzed on the design phase :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Controller::FormBuilder config problem
Michael Reece wrote: be wary of putting your base controller class in the MyApp/Controller/ directory, because catalyst will load it as a controller itself. which sucks if you want to put default inheritable actions in your base class. Why does it suck especially then? i use MyApp/Controller.pm for the base class to avoid this problem, since catalyst still, as far as i can tell, has no way to let you specify which controller classes to load or not load. Personally I use App/Base/Controller/Foo.pm, App/Base/Schema/Foo.pm, etc. Matt uses App/ControllerBase/Foo.pm IIRC. -- # Robert 'phaylon' Sedlacek # Perl 5/Catalyst Developer in Hamburg, Germany { EMail = ' [EMAIL PROTECTED] ', Web = ' http://474.at ' } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Catalyst::Controller::FormBuilder config problem
Hi, The config method as described in Catalyst::Controller::FormBuilder doesn't work for me. in MyApp.pm __PACKAGE__-config( name = 'MyApp', 'Controller::FormBuilder' = { new = { method = 'post', stylesheet = 1, messages = ':de_DE', }, }, ); Basically FormBuilder works, but there are no stylesheet tags and no localized messages generated. Only when i put a line of code into my controller: $self-formbuilder-stylesheet(1); But i'd like put the config only once in MyApp. I have installed pretty new CPAN modules (see my cpancheck script output) Thanks Ulrich CPAN: File::HomeDir loaded ok CPAN: Storable loaded ok Going to read /home/ulrich/.cpan/Metadata Database was generated on Tue, 19 Dec 2006 20:25:43 GMT Module Carp::Clan is installed as 5.7, could be updated to 5.8 from CPAN Module Compress::Zlib is installed as 1.42, could be updated to 2.001 from CPAN Module Cwd is installed as 3.21, could be updated to 3.24 from CPAN Module DBI is installed as 1.52, could be updated to 1.53 from CPAN Module Data::Dump is installed as 1.06, could be updated to 1.08 from CPAN Module Data::UUID is installed as 0.145, could be updated to 0.148 from CPAN Module Devel::PPPort is installed as 3.06_01, could be updated to 3.10 from CPAN Module Digest is installed as 1.14, could be updated to 1.15 from CPAN Module Digest::SHA is installed as 5.43, could be updated to 5.44 from CPAN Module Encode is installed as 2.12, could be updated to 2.18 from CPAN Module Encode::Alias is installed as 2.04, could be updated to 2.06 from CPAN Module Encode::Byte is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::CJKConstants is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::CN is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::CN::HZ is installed as 2.01, could be updated to 2.04 from CPAN Module Encode::Config is installed as 2.01, could be updated to 2.03 from CPAN Module Encode::EBCDIC is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::Encoder is installed as 2.00, could be updated to 2.01 from CPAN Module Encode::Encoding is installed as 2.02, could be updated to 2.04 from CPAN Module Encode::Guess is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::JP is installed as 2.01, could be updated to 2.03 from CPAN Module Encode::JP::H2Z is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::JP::JIS7 is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::KR is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::KR::2022_KR is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::MIME::Header is installed as 2.01, could be updated to 2.04 from CPAN Module Encode::MIME::Header::ISO_2022_JP is installed as 1.01, could be updated to 1.03 from CPAN Module Encode::Symbol is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::TW is installed as 2.00, could be updated to 2.02 from CPAN Module Encode::Unicode is installed as 2.02, could be updated to 2.03 from CPAN Module Encode::Unicode::UTF7 is installed as 2.01, could be updated to 2.04 from CPAN Module Error is installed as 0.17006, could be updated to 0.17008 from CPAN Module ExtUtils::Command is installed as 1.09, could be updated to 1.12 from CPAN Module ExtUtils::Command::MM is installed as 0.05, could be updated to 0.06 from CPAN Module ExtUtils::Install is installed as 1.33, could be updated to 1.41 from CPAN Module ExtUtils::Installed is installed as 0.08, could be updated to 1.41 from CPAN Module ExtUtils::Liblist is installed as 1.01, could be updated to 1.02 from CPAN Module ExtUtils::Liblist::Kid is installed as 1.3, could be updated to 1.31 from CPAN Module ExtUtils::MM is installed as 0.05, could be updated to 0.06 from CPAN Module ExtUtils::MM_AIX is installed as 0.03, could be updated to 0.04 from CPAN Module ExtUtils::MM_Any is installed as 0.13, could be updated to 0.14 from CPAN Module ExtUtils::MM_BeOS is installed as 1.05, could be updated to 1.06 from CPAN Module ExtUtils::MM_Cygwin is installed as 1.08, could be updated to 1.09 from CPAN Module ExtUtils::MM_DOS is installed as 0.02, could be updated to 0.03 from CPAN Module ExtUtils::MM_MacOS is installed as 1.08, could be updated to 1.09 from CPAN Module ExtUtils::MM_NW5 is installed as 2.08, could be updated to 2.09 from CPAN Module ExtUtils::MM_OS2 is installed as 1.05, could be updated to 1.06 from CPAN Module ExtUtils::MM_QNX is installed as 0.02, could be updated to 0.03 from CPAN Module ExtUtils::MM_UWIN is installed as 0.02, could be updated to 0.03 from CPAN Module ExtUtils::MM_Unix is installed as 1.50, could be updated to 1.51 from CPAN Module ExtUtils::MM_VMS is installed as 5.73, could be updated to 5.74 from CPAN
Re: [Catalyst] Catalyst::Controller::FormBuilder config problem
On 12/21/06, Ulrich Leodolter [EMAIL PROTECTED] wrote: Hi, The config method as described in Catalyst::Controller::FormBuilder doesn't work for me. in MyApp.pm RTM. You have the config options in the wrong place. Put them in your Controller class -- not in MyApp.pm. I recommend you create a MyApp::Controller::Base class and put it there and then have your controller's inherit from it. I tested the stylesheet option with the latest version CGI::FormBuilder and Catalyst::Runtime and it works for me. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Catalyst::Controller::FormBuilder Patch
Index: Controller/FormBuilder/Action/TT.pm === --- Controller/FormBuilder/Action/TT.pm (revision 5658) +++ Controller/FormBuilder/Action/TT.pm (working copy) @@ -12,4 +12,7 @@ $controller-_formbuilder; } +package Catalyst::Controller::FormBuilder::Action::TT::RenderView; +use base 'Catalyst::Action::RenderView'; + 1; Index: Controller/FormBuilder/Action/HTML/Template.pm === --- Controller/FormBuilder/Action/HTML/Template.pm (revision 5658) +++ Controller/FormBuilder/Action/HTML/Template.pm (working copy) @@ -133,4 +133,7 @@ } } +package Catalyst::Controller::FormBuilder::Action::TT::RenderView; +use base 'Catalyst::Action::RenderView'; + 1; Index: Controller/FormBuilder/Action/Mason.pm === --- Controller/FormBuilder/Action/Mason.pm (revision 5658) +++ Controller/FormBuilder/Action/Mason.pm (working copy) @@ -13,4 +13,7 @@ $controller-_formbuilder; } +package Catalyst::Controller::FormBuilder::Action::TT::RenderView; +use base 'Catalyst::Action::RenderView'; + 1; The issue: If Root.pm's controller is subclassed from Catalyst::Controller::FormBuilder it *demands* for Catalyst::Controller::FormBuilder::Action::TT::RenderView. The solution: This patch, provide Catalyst::Controller::FormBuilder::Action::template system::RenderView for all three template systems. Comments? There might be a better solution for this, however, this is adequate for my needs. -Victor ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/