Ah, ok.. does that mean my class has to implement the Describable interface? I'm really not yet familiar with all those Jenkins classes and interfaces :/ This "implements Action" and "extends TransientProjectActionFactory" combination is something I copied from another plugin because I knew it would accept the jobMain.jelly for the job page. Is there a solution that can fill the dropdown as well?
Am Donnerstag, 4. September 2014 schrieb Mads Nielsen : > I dont think an action is a describable object? So i dont think tour approach will work. > > Den 04/09/2014 20.26 skrev <[email protected]>: >> >> Thanks for replying! >> So now the code looks like this, right? >> >> public class JavaClass implements Action { >> >> private AbstractProject ap; >> public String selection; >> >> public JavaClass(AbstractProject ap) { >> this.ap = ap; >> } >> >> @DataBoundConstructor >> public JavaClass(String selection) { >> this.selection = selection; >> } >> >> public String getIconFileName() { >> return null; >> } >> >> public String getDisplayName() { >> return ""; >> } >> >> public String getUrlName() { >> return "something"; >> } >> >> @Extension >> public static final class DescriptorImpl extends TransientProjectActionFactory { >> >> public ListBoxModel doFillSelectionItems() throws IOException { >> ListBoxModel model = new ListBoxModel(); >> model.add("test"); >> return model; >> } >> >> @Override >> public Collection<? extends Action> createFor(AbstractProject target) { >> return Arrays.asList(new JavaClass(target)); >> } >> } >> } >> >> >> However the dropdown list is still empty. The doFill method is never called. >> Do you have another hint? >> >> -- >> 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]. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group. > To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/L8EO8GkZoaE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to [email protected]. > 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]. For more options, visit https://groups.google.com/d/optout.
