It cannot, as you have rendered the whole page before the user can select anything and the tag was not written to support list filtering.
The way to handle this would be to use a "wrapper" for the first drop down and then render the second drop down within the wrapper always... that means you will have NxM of the second drop down instances, but only ever one active at any point in time... But that would be an ugly hack... Are you sure you cannot think of another way to achieve this? (e.g. could you *enable and disable* some of the second descriptors via Javascript from a doCheckArtifact method's response? It would seem reasonable to show the full list and grey out the ones that are not valid for the artifact selection) On 27 October 2015 at 15:34, Kirill <[email protected]> wrote: > Hi noble Jenkins developers! > > It's quite easy to update one simple select (<f:select />) when another is > changed (see DynamicDropDownListBox from Jenkins UI Samples plugin). But > what about case when there are two <f:dropdownList/> elements? > > I have used DropdownList from UI Samples as a sample to create these: > > <f:block> > <table> > <j:set var="currentArtifactDefinition" > value="${instance.artifacts}"/> > <f:dropdownList name="artifacts" title="Artifact"> > <j:forEach var="desc" > items="${descriptor.artifactDescriptors}" varStatus="loop"> > <j:set var="artifactDescription" > value="${desc.class.name==currentArtifactDefinition.artifactsClassName?currentArtifactDefinition:null}"/> > <f:dropdownListBlock title="${desc.displayName}" > value="${loop.index}" selected="${artifactDescription!=null}" > staplerClass="${desc.entityClass.name}"> > <st:include page="${desc.configPage}" > from="${desc}"/> > </f:dropdownListBlock> > </j:forEach> > </f:dropdownList> > </table> > </f:block> > > <f:block> > <table> > <j:set var="currentScheduleDefinition" > value="${instance.schedule}"/> > <f:dropdownList name="schedule" title="Schedule"> > <j:forEach var="desc" > items="${descriptor.scheduleDescriptors}" varStatus="loop"> > <j:set var="scheduleDescription" > value="${desc.class.name==currentScheduleDefinition.scheduleClassName?currentScheduleDefinition:null}"/> > <f:dropdownListBlock title="${desc.displayName}" > value="${loop.index}" selected="${scheduleDescription!=null}" > staplerClass="${desc.entityClass.name}"> > <st:include page="${desc.configPage}" > from="${desc}"/> > </f:dropdownListBlock> > </j:forEach> > </f:dropdownList> > </table> > </f:block> > > There are two methods in Descriptor of the build step that has this > config.jelly, they provide the data for both dropdowns: > > public DescriptorExtensionList<MyBuildStep.ScheduleDefinition, > Descriptor<MyBuildStep.ScheduleDefinition>> getScheduleDescriptors() { > return > Jenkins.getInstance().getDescriptorList(MyBuildStep.ScheduleDefinition.class); > } > > public DescriptorExtensionList<MyBuildStep.ArtifactDefinition, > Descriptor<MyBuildStep.ArtifactDefinition>> getArtifactDescriptors() { > return > Jenkins.getInstance().getDescriptorList(MyBuildStep.ArtifactDefinition.class); > } > > But how can I handle the change event in the first one to customize the > selection in the second one? > > -- > 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/3744b377-beb9-4614-b6ec-8ac791b5e0a0%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CA%2BnPnMy-Pz%2BH0oUTiXo3O098tkQUjL1vkAEQg25wDmmQ3xWkDQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
