On 13/05/07, Andreas Marienborg <[EMAIL PROTECTED]> wrote:

I have a few questions though. As far as I can understand, one is
supposed to be able to split a form over several config-files? How does
one maintain order of fields in such an event?

I tried the following two files, which ends up putting the elements from
the included file first:
#forms/message_compose.yml
---
auto_fieldset: 1
elements:
    - type: select
      name: to
      label: To
      constraints:
          - Required

load_config_file: forms/message.yml

#forms/message.yml
---
indicator: title
auto_fieldset: 1
elements:
    - type: text
      name: title
      label: Subject
      constraints:
          - Required
    - type: textarea
      name: body
      label: Body
    - type: submit

The YAML is converted to an unordered perl hash - not a list - but
load_config_file() does accept an array of values, so you could do
either of these:

#forms/wrapper.yml
---
auto_fieldset: 1
load_config_file:
 - forms/message_compose.yml
 - forms/message.yml

OR

#forms/wrapper.yml
---
auto_fieldset: 1
elements:
 - type: block
   load_config_file: forms/message_compose.yml
 - type: block
   load_config_file: forms/message.yml

also, is it possible to make it (at least when using the controller base
class) so that I can load_from_config: message, so it is more consistant
with how the base-class loads config files?

Lets see what gets decided in the other thread first ;)
But, yes, a new option for HTML::FormFu to allow this would be a good idea.

Carl

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to