title: Jenkins: doFill Function doesn't fetch @QueryParameter properly
body: <p>I've been scratching my head over this for the past 2 days but haven't been able to find a solution...</p>
  
  <p>Basically, I have a plugin that has two dropdown lists ( jelly tags). One of them is be filled with all available project types, the other one should get filled with builders which are applicable to the previously selected project type. I'm building the plugin against Jenkins version 1.578.</p>
  
  <p>Here's my config jelly:</p>
  
  <pre><code>&lt;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"&gt;
  
    &lt;f:entry title="Projectname" field="projectName"&gt;
      &lt;f:textbox /&gt;
    &lt;/f:entry&gt;
    &lt;f:entry title="Build project after creation?" field="runProjectAfterCreation"&gt;
      &lt;f:checkbox /&gt;
    &lt;/f:entry&gt;
  
    &lt;f:entry title="Project configuration"&gt;
      &lt;f:entry title="Project / Job Type" field="projectType"&gt;
        &lt;f:select default="noTypeSelected" name="projectType"/&gt;
      &lt;/f:entry&gt;
  
      &lt;f:entry title="Build Steps"&gt;
        &lt;f:repeatable var="buildSteps" items="buildSteps" minimum="1"&gt;
          &lt;table width="100%" bgcolor="#EEEEEE"&gt;
            &lt;div width="100%"&gt;
              &lt;f:entry field="buildStepType"&gt;
                &lt;f:select default="noBuildStepSelected" /&gt;
                &lt;f:repeatableDeleteButton value="Delete Build Step" /&gt;
              &lt;/f:entry&gt;
            &lt;/div&gt;
          &lt;/table&gt;
        &lt;/f:repeatable&gt;
      &lt;/f:entry&gt;
  
    &lt;/f:entry&gt;
  &lt;/j:jelly&gt;
  </code></pre>
  
  <p>The projectType dropdown gets filled just fine with this function:</p>
  
  <pre><code>public ListBoxModel doFillProjectTypeItems() {
      ListBoxModel items = new ListBoxModel();
      items.add( "Bitte Projekttyp wählen", "noTypeSelected" );
      for ( TopLevelItemDescriptor tliDescriptor : getAvailableJobTypes() ) {
          items.add( tliDescriptor.getDisplayName(), tliDescriptor.getId() );
      }
      return items;
  
  }
  </code></pre>
  
  <p>But the buildStepType doesn't.</p>
  
  <pre><code>public ListBoxModel doFillBuildStepTypeItems( @QueryParameter( "../projectType" ) final String projectType ) {
      ListBoxModel items = new ListBoxModel();
      if ( ( !projectType.equals( "noTypeSelected" ) ) &amp;&amp; ( !projectType.equals( "hudson.maven.MavenModuleSet" ) ) ) {
          try {
              for ( BuildStepDescriptor&lt;? extends Builder&gt; buildStep : getAvailableBuilders( (Class&lt;? extends AbstractProject&lt;?, ?&gt;&gt;) Class
                      .forName( projectType ).asSubclass( AbstractProject.class ) ) ) {
                  items.add( buildStep.getDisplayName(), buildStep.getId() );
              }
          } catch ( ClassNotFoundException ex ) {
              throw new RuntimeException( ex );
          }
          // Maven projects will throw a java.lang.ClassNotFoundException
      } else if ( projectType.equals( "hudson.maven.MavenModuleSet" ) ) {
          items.add( "Mavenprojects are not supported!", "mavenSelected" );
      } else {
          items.add( "Choose project type first, please!", "noProjectType" );
      }
      return items;
  }
  </code></pre>
  
  <p>A <code>java.lang.reflect.InvocationTargetException</code> is caused by a <code>NullPointerException</code> at the following line:</p>
  
  <pre><code>if ( ( !projectType.equals( "noTypeSelected" ) ) &amp;&amp; ( !projectType.equals("hudson.maven.MavenModuleSet" ) ) )
  </code></pre>
  
  <p>because projectType is null. Apparently the <code>@QueryParameter</code> doesn't fetch the selected value from the first dropdown. It does "know that it's there" though, since the function gets called when I select a new project type.</p>
  
  <p>Does someone know a fix to this problem?</p>