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 :)