Your approach can’t work. The jelly part <j:set … > is evaluated and processed on the server side before the page is rendered in the client. I.e. it is called *before* your JS code is evaluated. You need to use AJAX to call a Java method in your event listener.
https://wiki.jenkins.io/display/JENKINS/AJAX+with+JavaScript+proxy > Am 05.02.2018 um 18:08 schrieb Virginia Mesa <[email protected]>: > > Hi, > I am developing a functionality in a Jenkins plugin, and I have a problem > when passing a variable to a Java method. > Let's see if I explain it well, and if you can help me: > > - What I want to do is to choose one of the options from a ComboBox, and this > option to pass it as a parameter to the method, so that the internally shows > me what I want. > So: > > <Auto Generated Inline Image 1.png> > > > 1. When I choose an option of the ComboBox, I have an EventListener that > collects that value ('SCT' in this case) and changes the value of the > variable pack_var. Up to here, everything OK. > > 2. Then I want to use that variable, to pass it as a parameter of a Java > method (the one I have declared inside the variable 'orderForPackage' that > is: getOrdersForPackage (pack_var), but when passing the variable in this > way, it does not do anything to me. > > > My question is how can I pass the value of the option obtained by parameter. > To get this out: > (Here I forced an option, but it would be the final result): > > <Auto Generated Inline Image 2.png> > > > > > > > > Resultados de la búsqueda > > Mi duda es como puedo pasar el valor de la opción obtenido por parámetro. > Para que me salga esto: (Aquí he forzado una opción, pero sería el resultado > final)t > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thaks! > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/bd8d4bb9-0f99-48ba-95dd-0b64ffcf0155%40googlegroups.com > > <https://groups.google.com/d/msgid/jenkinsci-dev/bd8d4bb9-0f99-48ba-95dd-0b64ffcf0155%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > <Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png> -- 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/076F2BC6-0D53-43AF-9E61-652CC2901B82%40gmail.com. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Message signed with OpenPGP
