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

f:select does not get proper value inside f:repetable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I'm having a problem with a dropdown menu generated by f:select not being set to the correct value upon the reloading of a job configuration page if the f:select appears inside an f:repeatable element. I have sample code where f:select by itself works fine: http://github.com/plouj/testHudsonSelect/tree/86cb5b9a0afd12168ee8940b81f0295e33189687 In this revision I am able to configure a list of options and select them from the dropdown menu. When I save the job configuration and reload the page the dropdown menu shows the previously selected option value. However, if I put f:select inside f:repeatable as in revision http://github.com/plouj/testHudsonSelect/tree/ca4e20bad7186821574cc39767d0456ea83456c1 everything works up to and including the saving of the selected option. the job config.xml file shows the value which I've selected. The problem is that when I reload the job configuration page, the dropdown menu shows what I think is the default value (top/first item) rather than what is stored in config.xml.
      The way to test this is go to hudson/configure and add two options: "option1" and "option2". Then on the job configuration page, create one 'configurable' item and select "option2" in the dropdown menu. Click save and reload the configuration page. Notice that the dropdown menu shows "option1" but the config.xml file says "option2".

        Attachments

          Issue Links

            Activity

            Hide
            pshivale Pramod Shivale added a comment -

            This way worked for me.
            <f:entry title="Select an option:" field="selectedOption">
            <f:select value="${selectedOption}" />
            </f:entry>

            Show
            pshivale Pramod Shivale added a comment - This way worked for me. <f:entry title="Select an option:" field="selectedOption"> <f:select value="${selectedOption}" /> </f:entry>

              People

              • Assignee:
                Unassigned
                Reporter:
                plouj plouj
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: