[JIRA] [active-choices-plugin] (JENKINS-33326) Programmatic changes to Reactive Reference value do not cascade

215 views
Skip to first unread message

imoutsatsos@msn.com (JIRA)

unread,
Mar 4, 2016, 1:55:02 PM3/4/16
to jenkinsc...@googlegroups.com
Ioannis Moutsatsos created an issue
 
Jenkins / Bug JENKINS-33326
Programmatic changes to Reactive Reference value do not cascade
Issue Type: Bug Bug
Assignee: Bruno P. Kinoshita
Components: active-choices-plugin
Created: 04/Mar/16 6:54 PM
Environment: Jenkins 1.596.1, Active-choices v 1.4
Priority: Minor Minor
Reporter: Ioannis Moutsatsos

I have two AC-Reactive Reference parameters. The first (A) is an input text box. The second (B) references the value of A and cascades when A-value is changed by user input. However, when A-value is changed programmatically by a javascript function, its value does not cascade to B, even after I force the A-input text box to fire an onchange() event.

The only way to cascade the A-value is for the user to click in the input text box and change something. Upon exit the A.value cascades to parameter B.

An onchange() event in the input text box should cascade the A-value to parameters that reference it.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

DanaGoyette@gmail.com (JIRA)

unread,
Mar 7, 2016, 7:51:02 PM3/7/16
to jenkinsc...@googlegroups.com
Dana Goyette commented on Bug JENKINS-33326
 
Re: Programmatic changes to Reactive Reference value do not cascade

I'm not certain if it's the same issue, but changing an Active Choices Parameter dropdown box selection via the arrow keys also fails to update Reactive Reference Parameters.

DanaGoyette@gmail.com (JIRA)

unread,
Mar 7, 2016, 7:59:01 PM3/7/16
to jenkinsc...@googlegroups.com
Dana Goyette updated an issue
 
Change By: Dana Goyette
Comment: I'm not certain if it's the same issue, but changing an Active Choices Parameter dropdown box selection via the _arrow keys_ also fails to update Reactive Reference Parameters.

brunodepaulak@yahoo.com.br (JIRA)

unread,
Mar 13, 2016, 3:22:01 AM3/13/16
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita commented on Bug JENKINS-33326
 
Re: Programmatic changes to Reactive Reference value do not cascade

Hi Ioannis!

I used an existing job in my development workspace to give it a try. Here's my test scenario:

  • 1 job with 2 AC parameters (normal one returning array [1,2,3,4], and another one referencing this first one). Both multi select parameters.
  • When I click with my mouse, changing the options in parameter #1, the parameter #2 gets updated as expected
  • The ID of the parameter #1 is multiple_select_choice-parameter-5757281551183_
  • Doing the following in my JS console changes the parameter value: jQuery("#multiple_select_choice-parameter-5757281551183_").val('2')
  • The parameter #2 is not updated
  • But typing the following in the JS console triggers the update in parameter #2: jQuery("#multiple_select_choice-parameter-5757281551183_").trigger('change')

So I assume you can trigger the parameters changes programmatically too. Does that help? Is there any other way I can try to reproduce the issue? Maybe I missed something from your current scenario, if so feel free to update the issue with some example or screen shots and I'll give it another go.

Cheers
Bruno

imoutsatsos@msn.com (JIRA)

unread,
Jun 11, 2016, 12:34:02 PM6/11/16
to jenkinsc...@googlegroups.com

imoutsatsos@msn.com (JIRA)

unread,
Sep 8, 2016, 9:01:02 PM9/8/16
to jenkinsc...@googlegroups.com
Ioannis Moutsatsos commented on Bug JENKINS-33326
 
Re: Programmatic changes to Reactive Reference value do not cascade

So what Bruno P. Kinoshita suggested works. Thanks!

However, the programmatic update of an Active Choice parameter via javascript suffers from the luck of a stable parameter element identifier. Every time the configuration is updated the div id changes.

Preferably, we will generate a stable element id for the formatted HTML element that the AC parameter generates and then use it to get the AC parameter ID dynamically.

So, if we provide each of the input boxes generated from ACRR_1 and ACRR_2 (referencing ACRR_1) in the example above an id lets say id1, id2 respectively, we can use the following pattern:

document.getElementById("id1").value = 'InputBox1_Value';
//now get the Active-Choice Reactive Reference ID programmatically-avoids luck of stable ID issue
parentId=document.getElementById("id1").parentNode.id
//the next line triggers an update to the ACRR_2
jQuery('#'+parentId).trigger('change')

This strategy allows one to use javascript to update Active Choice parameters and cascade these changes to other AC parameters that reference them.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

imoutsatsos@msn.com (JIRA)

unread,
Sep 8, 2016, 9:21:01 PM9/8/16
to jenkinsc...@googlegroups.com
Ioannis Moutsatsos resolved as Not A Defect
 

We are providing a reasonable workaround but this is probably not a bug in the first place, but rather the expected behavior. After a programmatic value change we have to* trigger an on change event* for the new values to cascade to other AC parameters that reference the original parameter.

Change By: Ioannis Moutsatsos
Status: Open Resolved
Resolution: Not A Defect

brunodepaulak@yahoo.com.br (JIRA)

unread,
Nov 4, 2016, 4:15:01 AM11/4/16
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita closed an issue as Not A Defect
 

Closed as not a defect

Change By: Bruno P. Kinoshita
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages