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

Data from f:dropdownList in a global.jelly is not named properly in JSON data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Macos, java 1.6.0_20, maven 2.2.1

      Im fixing some issues in the TFS plugin and am having problems with the f:dropdownList. When the data is submitted to the SCMs descriptor into the configure(StaplerReques, JSONObject) method the name for the list is empty. By looking at the JSON data I can see that the list result exists but the key is empty.

      Ive cleaned up my global.jelly file so it only looks like this:
      <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
      <f:section title="Team Foundation Server">
      <f:dropdownList name="fruit" title="Fruits">
      <f:dropdownListBlock title="a" value="A"/>
      <f:dropdownListBlock title="b" value="B"/>
      </f:dropdownList>
      </f:section>
      </j:jelly>

      And my configure() method looks like this:
      @Override
      public boolean configure(StaplerRequest req, JSONObject formData) throws FormException

      { System.out.println(formData); System.out.println("fruit=" + req.getParameter("fruit")); save(); return true; }

      And this is what it outputs:

      {"":"B"}

      fruit=null

            Unassigned Unassigned
            redsolo redsolo
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: