[Catalyst] Example of a catalyst application using FormFu to createa table

Wilson Jason Jason.Wilson at derm.qld.gov.au
Wed Jun 17 05:03:13 GMT 2009


All,

Unfortunately nobody has been able to help me with this.

After much more trial and error I have something that almost works.

An extract from the FromFu config looks like:
  - type: Hidden
    name: a_count

  - type: Block
    tag: table
    attributes:
      border: 1
   
    elements:
    - type: Repeatable
      tag: tr
      nested_name: list
      counter_name: a_count
      model_config:
        empty_rows: 1

      elements:
      - type: Hidden
        name: id

      - type: Block
        tag: td
        elements:
        - type: Text
          name: relationship

      - type: Block
        tag: td
        elements:
        - type: Select
          name: listnames

      - type: Block
        tag: td
        elements:
        - type: Checkbox
          name: delete_me
#          model_config:
#              delete_if_true: 1

This renders well enough for my purposes.

The problem is that the option to 'delete_if_true' doesn't work. There
is an error of the form:
[error] Caught exception in Cubs::Controller::Cub->formfu_edit "element
not found at
/usr/local/lib/perl5/site_perl/5.10.0/HTML/FormFu/Model/DBIC.pm line
352"

Reading the code here it would appear to be trying to find the relevant
'repeatable' for the model_config but cant as it is inside a nested
Block.

Any idea on how I might be able to work around this problem? I tried
moving the 'delete_if_true' onto the 'Block', but it just ignores it.

Thanks for any assistance,
  Jason


As of 26 March 2009 the Department of Natural Resources and Water/Environmental Protection Agency integrated to form the Department of Environment and Resource Management 

+----------------------------------------------------------------+
Think B4U Print
1 ream of paper = 6% of a tree and 5.4kg CO2 in the atmosphere
3 sheets of A4 paper = 1 litre of water
+----------------------------------------------------------------+





More information about the Catalyst mailing list