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

Mailing List Archive: Catalyst: Users

RE: Example of a catalyst application using FormFu to createa table

 

 

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


Jason.Wilson at derm

Jun 16, 2009, 10:03 PM

Post #1 of 4 (379 views)
Permalink
RE: Example of a catalyst application using FormFu to createa table

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
+----------------------------------------------------------------+



_______________________________________________
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/


devin.austin at gmail

Jun 16, 2009, 10:08 PM

Post #2 of 4 (358 views)
Permalink
Re: Example of a catalyst application using FormFu to createa table [In reply to]

Using FormFu this can be painful.

http://search.cpan.org/~snafufans/CatalystX-ListFramework-0.5/lib/CatalystX/ListFramework.pmwill
build you pretty tables of data.

hth,

Devin

On Tue, Jun 16, 2009 at 11:03 PM, Wilson Jason <Jason.Wilson[at]derm.qld.gov.au
> wrote:

>
> 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
> +----------------------------------------------------------------+
>
>
>
> _______________________________________________
> 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/
>



--
Devin Austin
http://www.codedright.net
http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!


fireartist at gmail

Jun 17, 2009, 12:52 AM

Post #3 of 4 (353 views)
Permalink
Re: Example of a catalyst application using FormFu to createa table [In reply to]

2009/6/17 Wilson Jason <Jason.Wilson[at]derm.qld.gov.au>:

> 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"

Hi,

This is already fixed in svn - r1528
And will be in the next cpan release.

Cheers,
Carl

_______________________________________________
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/


Jason.Wilson at derm

Jun 17, 2009, 5:07 PM

Post #4 of 4 (340 views)
Permalink
RE: Example of a catalyst application using FormFu to createa table [In reply to]

Carl Franks wrote:
> 2009/6/17 Wilson Jason <Jason.Wilson[at]derm.qld.gov.au>:
>
>> 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"
>
> Hi,
>
> This is already fixed in svn - r1528
> And will be in the next cpan release.

Thanks very much for that. Just grabbed down the latest DBIC.pm from the
SVN repository and threw it in. This will be sufficient for my testing
(toy application just for myself).

Works great now.

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
+----------------------------------------------------------------+



_______________________________________________
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.