[Catalyst] Help following instructions - FormFu issues
Derek W
derekwrobel at gmail.com
Thu Sep 20 23:17:49 GMT 2012
Hi All,
I am following the instructions from this tutorial:
http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/=
Tutorial/09_AdvancedCRUD/09_FormFu.pod
But am using my own database. I have a MS SQL database with 3 tables (no
primary keys) linked as follows:
Table: Groups
Columns: Groupid, Groupname, GroupDescription
Table: GroupsHosts
Columns: Groupid, Hostid
Table: Hosts
Columns: Hostid, HostName, HostIPAddress
Because these tables do not have a primary key set, to have Catalyst
function correctly, I had to manually add:
__PACKAGE__->set_primary_key( "hostid" );
and so forth for the groups and hosts schema\result\*.pm files
Everything in the tutorial so far has been working well and I am at the
point where I want to have more advanced CRUD in my application.
I can manually add a host, including a free text field that allows entry of
groupid, so that on creation of the host, it also inserts a record into the
groupshosts table.
However, trying to use this more advanced FormFu, following the exact
steps, I am able to get the form, with groups list box, but upon save, only
the host gets saved, and no group information is saved. No errors are
produced either.
I was trying to understand the steps in this tutorial, and do not even see
any place in this tutorial for FormFu that would also save the
groupid/hostid information to my groupshosts table. Is this because when
relationships are properly set up, FormFu can automatically handle this and
knows to save the groupid in the groupshosts table?
Do you know what I am missing that I cannot get the groupid entry to be
saved?
I would have thought the code in the controller for this formfu_create
would need code besides the $form->model->update($host); to save the
groupid as well.
Any help would be greatly appreciated.
Thanks,
-- =
Derek Wrobel
425-243-3355
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120920/82262=
e04/attachment.htm
More information about the Catalyst
mailing list