TRoderic has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks (been a while!),

I've been steadily falling for FormFu and DBIx::Class::Schema, but have finally found something that i'm either not describing to the search engine spirits correctly (probable) or no-one has tried to do before (unlikely). As such I request your aid on this hurdle.

Situation is as follows :

Essentially, I'm trying to get sum(form.entered is not null) from within the form fu repeatable element. YAML form specification as follows:

--- indicator: submitted elements: - type: Hidden name: count - type: Block tag: table elements: - type: Repeatable increment_field_names: 1 nested_name: SubBatches counter_name: count elements: - type: Hidden name: batch_uid - type: Block tag: tr elements: - type: Block tag: td elements: - type: Label name: batch_id - type: Block tag: td elements: - type: Label name: checkable - type: Block tag: td elements: - type: Select empty_first: 1 name: user_id model_config: resultset: User id_column: user_id label_column: user_name attributes: order_by: user_name - type: Block tag: td elements: - type: Label name: form_count - type: Block tag: td elements: - type: Label #right here i want sum(form.entered is not null) where batch_uid = cur +rent name: forms_entered - type: Block tag: td elements: - type: Label #and here, get sum of issues from forms in batch where batch_uid = cur +rent name: issues - type: Block tag: td elements: - type: Text name: forms_to_check - type: Block tag: td elements: - type: Text name: num_checked - type: Block tag: td elements: - type: Text name: errors - type: Block tag: td elements: - type: Text name: forms_wer

Firstly i'm at a loss as how to uniquely identify a section of forms from within the repeatable element, and secondly how to actually total the values from that element.

Any and all help would be greatly appreciated.

  • Comment on FormFu: Accessing sub query results from within a repeatable element
  • Download Code

Replies are listed 'Best First'.
Re: FormFu: Accessing sub query results from within a repeatable element
by Anonymous Monk on Jun 07, 2012 at 18:48 UTC