Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61385

Jelly 'enum' tag 'default' attribute not working

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Jenkins 2.60|2.224, Java Runtime Environemnt 8|11
    • 2.226

      The <f:enum>  tag from Jenkins Jelly form library has an attribue default that should set the field value for newly created forms.  It does not work because of the bug in the core/src/main/resources/lib/form/enum.jelly source file. As a result the HTML <select> will have no <option> selected which will make the first enum value be used when submitting a form instead of the wanted value.

        <f:entry field="ballColor">
          <f:enum default="YELLOW"/>
        </f:entry>

          [JENKINS-61385] Jelly 'enum' tag 'default' attribute not working

          Krzysztof Knapik created issue -
          Krzysztof Knapik made changes -
          Description Original: The {{*<f:enum>*}}  tag from Jenkins Jelly form library has an attribue '{{default}}' that should set the field value for newly created forms.  It does not work because of the bug in the {{core/src/main/resources/lib/form/enum.jelly}} source file. As a result the HTML {{<select>}} will have no {{<option>}} selected which will make the first enum value be used when submitting a form instead of the wanted value.
          {{}}
          {{  <f:entry field="ballColor">}}
          {{    <f:enum default="YELLOW"/>}}
          {{  </f:entry>}}
          {{}}
          New: The {{*<f:enum>*}}  tag from Jenkins Jelly form library has an attribue '{{default}}' that should set the field value for newly created forms.  It does not work because of the bug in the {{core/src/main/resources/lib/form/enum.jelly}} source file. As a result the HTML {{<select>}} will have no {{<option>}} selected which will make the first enum value be used when submitting a form instead of the wanted value.

           {{  <f:entry field="ballColor">}}
           {{    <f:enum default="YELLOW"/>}}
           {{  </f:entry>}}
          Krzysztof Knapik made changes -
          Description Original: The {{*<f:enum>*}}  tag from Jenkins Jelly form library has an attribue '{{default}}' that should set the field value for newly created forms.  It does not work because of the bug in the {{core/src/main/resources/lib/form/enum.jelly}} source file. As a result the HTML {{<select>}} will have no {{<option>}} selected which will make the first enum value be used when submitting a form instead of the wanted value.

           {{  <f:entry field="ballColor">}}
           {{    <f:enum default="YELLOW"/>}}
           {{  </f:entry>}}
          New: The {{*<f:enum>*}}  tag from Jenkins Jelly form library has an attribue *{{default}}* that should set the field value for newly created forms.  It does not work because of the bug in the *{{core/src/main/resources/lib/form/enum.jelly}}* source file. As a result the HTML {{<select>}} will have no {{<option>}} selected which will make the first enum value be used when submitting a form instead of the wanted value.

          {{  <f:entry field="ballColor">}}
           {{    <f:enum default="YELLOW"/>}}
           {{  </f:entry>}}

          I've created a pull request on GitHub with code fixes and tests for enum tag.

          Krzysztof Knapik added a comment - I've created a pull request on GitHub with code fixes and tests for enum tag.
          Daniel Beck made changes -
          Released As New: 2.226
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Mark Waite made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            Unassigned Unassigned
            knapsu Krzysztof Knapik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: