Child pages
  • Working with Dependent DB dropdowns

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConfiForms Form Definition
formNamef1e

 

categoryContractor CategorySELECT id, name FROM contractor_categories7422036e-9a6f-4455-92d9-7140131fb9dadbselect

subcategoryContractor Sub CategorySELECT id, name, contractor_categories_id FROM contractor_subcategories7422036e-9a6f-4455-92d9-7140131fb9dadbselect

subcategorycontractorcategoriesid:[entry.category.id]Apply Filter on a fieldcategory

"Dependency" is defined using "ConfiForms Field Definition Rule" with action to filter choices

...

Code Block
subcatid:[entry.category.id]

...


Code Block
  <ac:structured-macro ac:macro-id="14859127-f36f-4e7f-9de8-219a6790b6e3" ac:name="confiform" ac:schema-version="1"

...

>
  <ac:parameter ac:name="formName">f</ac:

...

parameter>
  <ac:rich-text-

...

body>
    <ac:structured-macro ac:macro-id="fa517b7f-eabf-4755-bfa2-c3fce043bcc4" ac:name="confiform-entry-register"
                         ac:schema-version="1"

...

>
      <ac:rich-text-

...

body>
        <p></p>
      </ac:rich-text-

...

body>
    </ac:structured-

...

macro>
    <p>
      <ac:structured-macro ac:macro-id="b2f153ba-f8ac-455b-b63b-ea07252f149a" ac:name=

...

"confiform-field-definition"
                           ac:schema-version="1"

...

>
        <ac:parameter ac:name="fieldName">category</ac:

...

parameter>
        <ac:parameter ac:name="fieldLabel">Contractor Category</ac:

...

parameter>
        <ac:parameter ac:name="values">SELECT id as "myid", name as "myname" FROM contractor_categories</ac:

...

parameter>
        <ac:parameter ac:name="extras">7422036e-9a6f-4455-92d9-7140131fb9da</ac:

...

parameter>
        <ac:parameter ac:name="type">dbselect</ac:

...

parameter>
      </ac:structured-

...

macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="77520462-dc4e-44d5-94f0-19fce73e80db" ac:name="confiform-field-definition"
                           ac:schema-version="1"

...

>
        <ac:parameter ac:name="fieldName">subcategory</ac:

...

parameter>
        <ac:parameter ac:name="fieldLabel">Contractor Sub Category</ac:

...

parameter>
        <ac:parameter ac:name="values">SELECT id, name, contractor_categories_id as "subcatid

...

" FROM
          contractor_subcategories
        </ac:parameter>
        <ac:parameter ac:name="extras">7422036e-9a6f-4455-92d9-7140131fb9da</ac:

...

parameter>
        <ac:parameter ac:name="type">dbselect</ac:

...

parameter>
      </ac:structured-

...

macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="229b7d63-5896-4b43-b1ec-c06adfdc2a3f" ac:name=

...

"confiform-field-definition-rules"
                           ac:schema-version="1"

...

>
        <ac:parameter ac:name="fieldName">subcategory</ac:

...

parameter>
        <ac:parameter ac:name="values">subcatid:[entry.category.id]</ac:

...

parameter>
        <ac:parameter ac:name="action">Apply Filter on a field</ac:

...

parameter>
        <ac:parameter ac:name="actionFieldName">category</ac:

...

parameter>
      </ac:structured-

...

macro>
    </

...

p>
  </ac:rich-text-

...

body>
</ac:structured-macro>