I need a work around for the optionalBlock, because if it's checked everything works well, the instance of my separate class (GenerateReport) is created and passed to the builder's @DataBoundConstructor, however I have set "@Nullable GenerateReport generateReport" because if the optionalBlock is not checked the <st:include > is never called and no object is created, thus losing the values from the generate report config.jelly... how can I handle this (persist them regardless of optionalBlock option)?
or replace the optionalBlock with a similar option to hide/show certain fields? On Friday, June 24, 2016 at 4:50:00 PM UTC+1, Tiago Lopes wrote: > > I have implemented the separate class, I'm using <st:include ../> to > include its config.jelly (it's not finding with the f:property [searching > in the wrong package]) and it's working as before, meaning... > > this did in no way solve my problem, actually made it more complex, as now > I'm storing the values in a different class and not in the one where I need > them, also, how come I don't need optionalBlock? what's the other option? > > All I managed to do was include the configuration form, as it was, still > no values being persisted. > > On Wednesday, June 22, 2016 at 6:45:08 PM UTC+1, Jesse Glick wrote: >> >> You are doing too much work. Create a separate class extending >> `AbstractDescribableImpl` with its own `config.jelly` and just use >> `f:property` to include its configuration form. You do not need to use >> low-level controls like `f:optionalBlock` or deal with raw JSON form >> data. >> > -- 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/86499761-0686-4365-93f2-635c13314187%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
