Dynamic elements on configuration page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic elements on configuration page

Nikhil Bhoski

Hi All,

I am trying to populate and element on My configuration page based on values of other element on same page without having to do refresh . For eg: I have two types of  elements on config page one is drop-down box and other is set of check boxes. I want to show selected text boxes on my Jenkins configuration page based on the value user selects from dropdown. Please suggest if any way possible doing this without having to refresh the page . 


I tried something to achieve this using below method in my Descriptor class however i am not sure now how to read the value of this element in my builder class.

 public FormValidation doCheckLocal(@QueryParameter String local){
  
  if(local.isEmpty()){
  
  return FormValidation.respond(Kind.OK, "<input type=checkbox name=cob> Creport<br>");
  
  }
  
  return FormValidation.ok();
  }

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d4143f7d-ff8d-4cf9-bdae-c8543299d213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic elements on configuration page

Ulli Hafner
The UI examples plugin has an example that shows you how to use different views if an element in a list box has been selected.

Am 20.09.2018 um 08:27 schrieb Nikhil Bhoski <[hidden email]>:


Hi All,

I am trying to populate and element on My configuration page based on values of other element on same page without having to do refresh . For eg: I have two types of  elements on config page one is drop-down box and other is set of check boxes. I want to show selected text boxes on my Jenkins configuration page based on the value user selects from dropdown. Please suggest if any way possible doing this without having to refresh the page . 


I tried something to achieve this using below method in my Descriptor class however i am not sure now how to read the value of this element in my builder class.

 public FormValidation doCheckLocal(@QueryParameter String local){
  
  if(local.isEmpty()){
  
  return FormValidation.respond(Kind.OK, "<input type=checkbox name=cob> Creport<br>");
  
  }
  
  return FormValidation.ok();
  }

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d4143f7d-ff8d-4cf9-bdae-c8543299d213%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/27F0578C-03FB-4A1F-9571-92FE848B2753%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc (540 bytes) Download Attachment