Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Bug with re-occuring nested related tables with CP FormFu?

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


toby.corkindale at strategicdata

May 29, 2009, 1:41 AM

Post #1 of 2 (458 views)
Permalink
Bug with re-occuring nested related tables with CP FormFu?

Hi,
I'm using FormFu in Catalyst, with a DBIC schema, and have a problem
with a particular usage of nested relationships in the form.

The table in question has a might_have relationship with another table,
let's say like:
book (id, title, blurb)
book_extra (book_id, num_pages, in_stock)

Now, I setup a form like:
---
elements:
- name: title
type: Text
- type: Block
tag: div
nested_name: book_extra
elements:
- name: num_pages
type: Text
- name: blurb
type: Textarea
- type: Block
tag: div
nested_name: book_extra
elements:
- name: in_stock
type: Checkbox

-----------------------------

The idea being that num_pages and in_stock are sent to the related table
instead.

This *does* work for the first nested item, in this case num_pages.
However the second time it comes up, it doesn't do anything - ie.
in_stock is never saved to the DB.
If I move the in_stock element higher up, in the same Block as
num_pages, then it does work.

Is this a known bug/limitation, or is this supposed to work?
Am I doing something wrong?

thanks,
Toby

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


tech at swattermatter

Aug 21, 2009, 5:55 AM

Post #2 of 2 (271 views)
Permalink
Re: Bug with re-occuring nested related tables with CP FormFu? [In reply to]

You are missing the counter_name and new_rows_max for the repeatables.
Look at this bit of YAML that Moritz gave me. You might also look at the
empty_rows option. Your problem is the counter_name, though.

- type: Hidden
name: count
constraints:
- Required
- type: Repeatable
nested_name: appointment
counter_name: count
model_config:
new_rows_max: 100
elements:
...

Toby Corkindale wrote:
> Hi,
> I'm using FormFu in Catalyst, with a DBIC schema, and have a problem
> with a particular usage of nested relationships in the form.
>
> The table in question has a might_have relationship with another
> table, let's say like:
> book (id, title, blurb)
> book_extra (book_id, num_pages, in_stock)
>
> Now, I setup a form like:
> ---
> elements:
> - name: title
> type: Text
> - type: Block
> tag: div
> nested_name: book_extra
> elements:
> - name: num_pages
> type: Text
> - name: blurb
> type: Textarea
> - type: Block
> tag: div
> nested_name: book_extra
> elements:
> - name: in_stock
> type: Checkbox
>
> -----------------------------
>
> The idea being that num_pages and in_stock are sent to the related
> table instead.
>
> This *does* work for the first nested item, in this case num_pages.
> However the second time it comes up, it doesn't do anything - ie.
> in_stock is never saved to the DB.
> If I move the in_stock element higher up, in the same Block as
> num_pages, then it does work.
>
> Is this a known bug/limitation, or is this supposed to work?
> Am I doing something wrong?
>
> thanks,
> Toby
>
> _______________________________________________
> List: Catalyst[at]lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.