I finally managed it to get it fixed (at least in my plugin). I think there still I a bug in Stapler here:
If I define the validation method using:
public FormValidation doCheckHighThreshold(@QueryParameter final int
highThreshold,
@QueryParameter final int normalThreshold) {
return VALIDATION.validateHigh(highThreshold, normalThreshold);
}
then in the generated HTML the attribute checkdependson is empty:
<input checkdependson="" default="50"
checkurl="/view/White%20Mountains/job/New%20-%20Pipeline%20-%20Model/pipeline-syntax/descriptorByName/cpd/checkHighThreshold"
name="_.highThreshold" type="text" class="setting-input validated "
value="50">
If I rather use
public FormValidation doCheckHighThreshold(@QueryParameter(value =
"highThreshold") final int highThreshold,
@QueryParameter(value = "normalThreshold") final int normalThreshold) {
return VALIDATION.validateHigh(highThreshold, normalThreshold);
}
Then in the generated HTML the attribute checkdependson is correct:
<input checkdependson="highThreshold normalThreshold" default="50"
checkurl="/view/White%20Mountains/job/New%20-%20Pipeline%20-%20Model/pipeline-syntax/descriptorByName/cpd/checkHighThreshold"
name="_.highThreshold" type="number" class="setting-input validated "
value="50">
>From the documentation of @QueryParameter: if value is not given, then the
>name of the parameter should be used.
> Am 23.03.2018 um 15:25 schrieb Jesse Glick <[email protected]>:
>
> On Thu, Mar 22, 2018 at 7:05 PM, Ullrich Hafner
> <[email protected]> wrote:
>> I created an issue: JENKINS-50355.
>
> Most likely some typo or other bug in your plugin code, but hard to
> know offhand. If there a simple way to reproduce this problem locally,
> state that in the issue.
>
>> Maybe the problem is that the views are in different plugins and are loaded
>> by different class loaders...
>
> Should not matter.
>
> --
> 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/CANfRfr3cDq%3D3_Jjzt%3DJRcsbmdZ4wja75qY%2BqFzRJ314Z4cMhRg%40mail.gmail.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/7E4CC619-5913-4D52-A7F7-4D82C93E1A23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Message signed with OpenPGP
