Tapestry
  1. Tapestry
  2. TAPESTRY-1529

Unusable FieldLabel in combination with a group of radio options

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.5
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Windows XP, Sun JRE 1.5, JBoss 4.0.4

      Description

      The FieldLabel component requires for the parameter "field" a component of the type "IFormComponent".

      I want the labels to be generated for every radio button entry:
      O <label for="entry1">1st entry</label>
      O <label for="entry2">2nd entry</label>
      O <label for="entry3">3rd entry</label>

      So the user can click on the entry label to select the desired option.

      <span jwcid="group@RadioGroup">
      <span jwcid="@For" source="prop:source" volatile="true" value="ognl:staticSelection">
      <input jwcid="radio@Radio" value="ognl:staticSelectionValue" type="radio" class="radio" />
      <label jwcid="@FieldLabel" prerender="false" field="component:radio"
      displayName="prop:staticSelectionLabel" class="clickable">Static Label</label>
      </span>
      </span>

      But the component "Radio" is of type "AbstractComponent" and therefore can't be assigned to the "field" parameter.

      I think the type of the "Radio" component should be changed to AbstractFormComponent because it IS a form component
      in any case.

      P.S.: If I assign field="component:group" then there is no effect because I get
      O <label for="group">1st entry</label>
      O <label for="group">2nd entry</label>
      O <label for="group">3rd entry</label>
      which is useless.

      Thank you!

        Activity

        Hide
        Andrej Aschenbrenner added a comment -

        See the Checkbox component. Why does it extend from AbstractFormComponent and the Radio component not? They should be treated likewise.

        Show
        Andrej Aschenbrenner added a comment - See the Checkbox component. Why does it extend from AbstractFormComponent and the Radio component not? They should be treated likewise.
        Hide
        Andreas Andreou added a comment -

        for now, use:

        <input jwcid="radio@Radio" value="ognl:staticSelectionValue" type="radio" class="radio" />
        <label jwcid="@Any" for="clientId:radio" class="clickable"><span jwcid="@Insert" value="prop:staticSelectionLabel">Static Label</span></label>

        Show
        Andreas Andreou added a comment - for now, use: <input jwcid="radio@Radio" value="ognl:staticSelectionValue" type="radio" class="radio" /> <label jwcid="@Any" for="clientId:radio" class="clickable"><span jwcid="@Insert" value="prop:staticSelectionLabel">Static Label</span></label>
        Hide
        Ben Dotte added a comment -

        Radio now extends from AbstractFormComponent. I have verified it works with FieldLabel now.

        Show
        Ben Dotte added a comment - Radio now extends from AbstractFormComponent. I have verified it works with FieldLabel now.

          People

          • Assignee:
            Ben Dotte
            Reporter:
            Andrej Aschenbrenner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development