Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1056

[Roadmap] Cocoon Forms field styling: selection lists with optgroups

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.1.8
    • None
    • Blocks: Forms
    • None
    • Operating System: All
      Platform: All
    • 27147

    Description

      I've needed optgroups in my selection lists. I found that I can wrap wd:item
      elements by other elements so I modified woody-field-styling.xsl so that it
      creates optgroup elements, when wd:items are wrapped in
      wi:group[wi:styling/@type='optgroup']/wi:items

      Example:

      <wd:selection-list>
        <wd:item value="1">
          <wd:label>option 1</wd:label>
        </wd:item>
        <wd:item value="1">
          <wd:label>option 2</wd:label>
        </wd:item>

        <wi:group>
          <wi:styling type="optgroup"/>
          <wi:label>group I</wi:label>
          <wi:items>

            <wd:item value="I.1">
              <wd:label>option I.1</wd:label>
            </wd:item>

            <wd:item value="I.2">
              <wd:label>option I.2</wd:label>
            </wd:item>
          </wi:items>
        </wi:group>
        
        <wi:group>
          <wi:styling type="optgroup"/>
          <wi:label>group II</wi:label>
          <wi:items>

            <wd:item value="II.1">
              <wd:label>option II.1</wd:label>
            </wd:item>

            <wd:item value="II.2">
              <wd:label>option II.2</wd:label>
            </wd:item>
          </wi:items>
        </wi:group>
        
      </wd:selection-list>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              okrasz@o2.pl Marcin Okraszewski
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: