サブフォーム

list フィールド、yaml フィールド、ウィザードのページで使う、再利用可能なフォームの断片


サブフォームは、再利用可能なフォームの断片です。タイル表示には表示されず、直接送信することもできません。代わりに、次のものから参照されます。

  • list フィールド: 各行のドリルダウンエディターとしてサブフォームを開きます
  • subform プロパティを持つ yaml フィールド: 1 つのオブジェクトのドリルダウンエディターとしてサブフォームを開きます
  • wizard のステップ: サブフォームをウィザードの 1 ページとして表示します

A reusable form fragment used as the per-row editor of a list field, or as the single-object editor of a yaml field with the subform property.
Subforms are not shown in the tile view and cannot be submitted directly.
They share the same field types and validation rules as regular forms.

Address subform

- name: Address
  type: subform
  fields:
    - name: street
      type: text
      label: Street
      required: true
    - name: city
      type: text
      label: City
      required: true
    - name: country
      type: text
      label: Country
      required: true
- name: My Main Form
  type: ansible
  playbook: site.yml
  roles:
    - default
  fields:
    - name: addresses
      type: list
      label: Addresses
      subform: Address

プロパティ

サブフォームには 種類に固有のプロパティはありません。 フォームの共通プロパティ である name、 description、 help、 type、 fields だけを使います。

サブフォームをウィザードのページとして使う場合、その description と help がステップの title と help の既定値になります。 showHelp を設定して、ページの読み込み時にそのヘルプを展開することもできます。

実行に関するプロパティ ( playbook、 template、 roles、 inventory など) は、サブフォームには適用されません。サブフォームが直接送信されることはないためです。