First off your doFill method should be called doFill<FieldAttribute>Items

Take a look here for creating a listener: 
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/cmd/ShowStreams.java#L133-L153
and for build env look 
here: 
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/AccurevLauncher.java#L479-L493

Hope that helps

Den torsdag den 6. april 2017 kl. 02.08.22 UTC+2 skrev JordanGS:
>
> 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/c4c89eb0-e4a2-4d97-83ee-b32cd14e54b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to