I have two elements, a text box which takes a path and a drop down list 
below it that will populate the drop down list. How do i modify the doFill 
Items method to expand the value. See below method

zapSettingsDir is the textbox with the path from the jelly config file.

  <f:section title="${%ZAP Settings}">
    <f:entry title="${%Path}" field="zapSettingsDir">
      <f:textbox clazz="required" />
    </f:entry>
  </f:section>

and the associated java code is

        public ListBoxModel doFillActiveScanPolicyItems(@QueryParameter 
String zapSettingsDir) {
            ListBoxModel items = new ListBoxModel();

            /* No workspace before the first build, so workspace is null. */
            if (workspace != null) {
                File[] listFiles = {};
                try {
                    listFiles = workspace.act(new PolicyFileCallable(
zapSettingsDir));
                }
                catch (IOException e) {
                    e.printStackTrace(); /* No listener because it's not 
during a build but it's on the job config page. */
                }
                catch (InterruptedException e) {
                    e.printStackTrace(); /* No listener because it's not 
during a build but it's on the job config page. */
                }

                items.add(""); /* To not load a policy file, add a blank 
choice. */

                for (File listFile : listFiles)
                    items.add(FilenameUtils.getBaseName(listFile.getName
())); /* Add policy files to the list, without their extension. */
            }
            return items;
        }

My problem being that i have no build variable at the moment and no 
listener since it's not at the build step yet but on the job's config page. 
Thanks :)

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/d6508b7c-8971-4b99-b9d6-9d1372cfadcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to