You're looking for an example of Rose::HTML::Form in use? How about
the synopsis here?
http://search.cpan.org/dist/Rose-HTML-Objects/lib/Rose/HTML/Form.pm
-John
Thanks for replying John and Peter.
Starting from the RHFRR man page (perldoc)
package MyRDBO::Class::Form;
use strict;
use base qw( Rose::HTMLx::Form::Related::RDBO );
sub init_object_class { 'MyRDBO::Class' }
1;
I get an error that I must define init_metadata(), or pass a
metadata object in the new(). I presume it is looking for
metadata on MyRDBO::Class, and I also presume that the
init_object_class method defined above is meant to provide the
information required, which means I must have something screwed up
to be seeing the message. Thinking the tests might have an
answer, I notice that the DBIC example has init_app_class()
instead of init_object_class(). Neither (or both together) works.
Having:
use MyRDBO::Class;
defined above (after the use base statement), doesn't help
anything.
Going back to my test program, I generate a metadata object and
pass it as an argument in the new():
use Rose::DB::Object::Metadata;
my $meta = Rose::DB::Object::Metadata->new( class =>
'MyRDBO::Class' );
my $formx = MyRDBO::Class::Form::TableName->new( $meta );
And this gets a different error. But, I've been single stepping
perldb in emacs for 6 hours already today and I figured that I
would send another note, while I take a break.
I've been changing package names above to match the POD, the dump
below has the original names.
Cannot set element for EngMaterielSpec::FormX::BranchTable at
/home/ghaverla/src/perl/rheaume/Mojolicious/Lite/bh.pl line 24
at /usr/local/share/perl/5.12.3/Rose/HTML/Form/Field.pm line 684
Rose::HTML::Form::Field::element('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00)',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/share/perl5/Rose/Object.pm line 25
Rose::Object::init('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00)',
'element', 'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Object.pm line 280
Rose::HTML::Object::init('element',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Form.pm line 186
Rose::HTML::Form::init('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00)',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTMLx/Form/Related.pm line 68
Rose::HTMLx::Form::Related::init('EngMaterielSpec::FormX::BranchTable=HASH(0xa180e00)',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/usr/local/share/perl/5.12.3/Rose/HTML/Form.pm line 125
Rose::HTML::Form::new('EngMaterielSpec::FormX::BranchTable',
'Rose::DB::Object::Metadata=HASH(0xb830064)') called at
/home/ghaverla/src/perl/rheaume/Mojolicious/Lite/bh.pl line 24
Gord
[ snip ]
I don't know. I can get my own routines which generate popupmenus
of stuff to work, but doing something simple like having this
module (HTFRR) generate a form for a table that consists of 2
columns, one is a primary key and the other is a UNIQUE column
just keeps coming up with errors. Single stepping through things
and looking at variables, it is not apparent what the problem is.
But, there are vanishingly few comments in the code, so I have no
idea if having empty lists in certain places is unusual or not.
If the generic .pm in the perldoc works for some people, but
generates errors for me, all I can think of is there is something
in my configuration which is "wrong". And I've pretty much
exhausted what I can change in doing this. Heck, I was using
FormX as a directory early on, and I thought maybe something was
sensitive to that capital X at the end, so I changed the modules,
packages and directories to use Form. No difference, the same
error messages.
The other thing that comes to mind, is that there is vanshingly
little data in what I have in my database (most of the data is an
enumeration of some kind). Most tables have primary keys, and
most tables with more than 2 columns are filled with foreign keys.
And there are 3 pivot tables present for Many-to-Many
relationships. Is interrelated giving up?
At this point, I am going to give up on Related::RDBO. I really
didn't think it was going to help my situation because of how
dense the foreign keys are: but between the documentation, the
test examples in the CPAN module and the source, I have no idea
where the problem is.
Gord