On Fri, Mar 5, 2021 at 10:14 AM Ivan Martinez <[email protected]>
wrote:
> I have seen that a different type of object can be referenced, which is
> the ${instance}. I have tried by modifying the references to ${it} and
> replace them by ${instance}. In this case, it does refer to the
> HelloWorldBuilder class, but, this object is null when adding the build
> step into a job for the first time. Once I save the job and re-configure,
> the drop-down list is populated, since the instance is created.
>
Right, `instance` is set only during reconfiguration. `descriptor` is
always set.
If you are using high-level form controls, you should normally need to pay
attention to `it` and `instance`. `descriptor` would be used for example to
let you load a list of options from Java (your `DescriptorImpl`).
the data does not seem to be persisted, I have debugged and indeed the
> DataBoundConstructor for HelloWorldBuilder is invoked and the Fruit object
> is passed to it, but in further re-configurations of the job step, it is
> not persisted.
>
Check whether the actual `config.xml` is saved correctly.
I think your issue is that you are looking at the `DropdownList` example,
which is using low-level form controls. For the purposes of typical
plugins, you can ignore all that. The `HeteroList` example is more relevant
(specifically the objects *inside* it starting with `Config`). Basically
use controls which have a `field` attribute.
--
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/CANfRfr2K_Gk649Wf2rJqLh5f4QgtfYuQsLsGFMNX8hT%2Bdp2svg%40mail.gmail.com.