1

我正在创建一个具有选择组件的创作对话框。选项一的选择只有一个输入。选择的选项二有两个输入,一个是必需的。目前我无法提交选项一,因为选项二中需要输入。是否可以在未使用的选项中包含所需的输入?

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" jcr:title="Settings" sling:resourceType="cq/gui/components/authoring/dialog">
  <content
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
    <items jcr:primaryType="nt:unstructured">
      <column
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container">
        <items jcr:primaryType="nt:unstructured">
          <type
            jcr:primaryType="nt:unstructured"
            jcr:title="Type"
            sling:resourceType="granite/ui/components/coral/foundation/form/select"
            fieldLabel="Type"
            granite:class="cq-dialog-dropdown-showhide"
            name="./type"
            required="{Boolean}true">
            <items jcr:primaryType="nt:unstructured">
              <one
                jcr:primaryType="nt:unstructured"
                text="Option One"
                value="one"/>
              <two
                jcr:primaryType="nt:unstructured"
                text="Option Two"
                value="two"/>
            </items>
            <granite:data
              jcr:primaryType="nt:unstructured"
              cq-dialog-dropdown-showhide-target=".tileType-show-hide"/>
          </type>
          <oneOption
            jcr:primaryType="nt:unstructured"
            granite:class="tileType-show-hide"
            sling:resourceType="granite/ui/components/coral/foundation/container">
            <items jcr:primaryType="nt:unstructured">
              <one
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                fieldLabel="Input One"
                name="./inputOne"/>
            </items>
            <granite:data
              jcr:primaryType="nt:unstructured"
              showhidetargetvalue="one"/>
          </oneOption>
          <twoOptions
            jcr:primaryType="nt:unstructured"
            jcr:title="Settings"
            granite:class="tileType-show-hide"
            sling:resourceType="granite/ui/components/coral/foundation/container">
              <items jcr:primaryType="nt:unstructured">
                <column
                  jcr:primaryType="nt:unstructured"
                  sling:resourceType="granite/ui/components/coral/foundation/container">
                  <items jcr:primaryType="nt:unstructured">
                    <one
                      jcr:primaryType="nt:unstructured"
                      sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                      fieldLabel="Input One"
                      name="./inputOne"/>
                    <two
                      jcr:primaryType="nt:unstructured"
                      sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
                      fieldLabel="Input Two"
                      name="./inputTwo"
                      required="{Boolean}true"/>
                  </items>
                </column>
              </items>
            <granite:data
              jcr:primaryType="nt:unstructured"
              showhidetargetvalue="two"/>
          </twoOptions>
        </items>
      </column>
    </items>
  </content>
</jcr:root>

4

0 回答 0