Page tree

Versions Compared

Key

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

...

ConfiForms Form Definition
formNameform2
form2INLINE


searchsearchType to make a lookup in form1, supports * searchestext


background-color:#c0c0c0;selectedSelected choice[42927284|form1|choice|true||]smartselect

background-color:#c0c0c0;paramStatusParam statusread_only

-- will set selected and paramStatus fields

!search:[empty]selected=[entry.id]&paramStatus=[entry.param]choice:[entry.search]Lookup and set valuesearchform1:@selfLIMIT 1


In editor mode you will have something like this

Image Added


Where the "Rules for Field Definition macro" in form2 is configured like this


Image AddedImage AddedImage Added



Source code for the demo (please note that forms in the source code are names form11 and form21 instead of form1 and form2)

Warning

Smart field configuration will require a change to point at your page (by id)

<ac:parameter ac:name="values">[42927284|form11|choice|true||]</ac:parameter>

Code Block

<p>1st form with params and choices</p>
<ac:structured-macro ac:macro-id="f04fb496-0467-468b-952c-995c3d1f9b41" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">form11</ac:parameter>
  <ac:parameter ac:name="registrationFormTitle">Form 11</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="0fa171ef-4741-4bec-a361-a415e37a4be0" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="formName">form1</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="6fb3c02a-0c6b-49a7-a067-3a76b77657fb" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">choice</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Choice</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="0b83c012-e3cb-4444-80f5-475b12190b4b" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">param</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Param</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>Choices</p>
<ac:structured-macro ac:macro-id="8a9c7859-802a-4891-a0ff-d12b5928663f" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">form11</ac:parameter>
  <ac:rich-text-body>
    <p>
      <br/>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>2nd form with a smart field which we will set based on the search made in the search field</p>
<ac:structured-macro ac:macro-id="676b49ee-01d2-4360-ade4-2c819d6baa5f" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">form21</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="96d2c853-bf81-4fd5-b1e4-be45a29d410e" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="formName">form21</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="b1d6dbb1-25c1-4aa4-9625-861de3119730" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">search</ac:parameter>
        <ac:parameter ac:name="fieldLabel">search</ac:parameter>
        <ac:parameter ac:name="fieldDescription">Type to make a lookup in form11, supports * searches</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <br/>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="5518ec01-0156-401a-a2b6-960abca948d9" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="css">background-color:#c0c0c0;</ac:parameter>
        <ac:parameter ac:name="fieldName">selected</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Selected choice</ac:parameter>
        <ac:parameter ac:name="values">[42927284|form11|choice|true||]</ac:parameter>
        <ac:parameter ac:name="type">smartselect</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="c3dbda96-7a3d-4f80-8c6c-df44f1f76766" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="css">background-color:#c0c0c0;</ac:parameter>
        <ac:parameter ac:name="fieldName">paramStatus</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Param status</ac:parameter>
        <ac:parameter ac:name="type">read_only</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>-- will set selected and paramStatus fields</p>
    <p>
      <ac:structured-macro ac:macro-id="64f2f557-accf-4bc8-a624-a72ddf168aac" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">!search:[empty]</ac:parameter>
        <ac:parameter ac:name="fieldName">selected=[entry.id]&paramStatus=[entry.param]</ac:parameter>
        <ac:parameter ac:name="values">choice:[entry.search]</ac:parameter>
        <ac:parameter ac:name="action">Lookup and set value</ac:parameter>
        <ac:parameter ac:name="actionFieldName">search</ac:parameter>
        <ac:parameter ac:name="values2">form11:@self</ac:parameter>
        <ac:parameter ac:name="values3">LIMIT 1</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

...