Anonymous_User Absent Member.
Absent Member.
179 views

False Firing of the onchange Event for 2-List Picklist


Currently using 4.0.2 User Application.

Testing the workflow in Chrome 35.0.1916.153 (Working on downloading
other browsers currently)

I have a picklist with the following settings enabled:

multi-valued: true
Allow multiple selections (true/false): true
Show 2 lists: true

I have an onchange function the delivers a form.alert() message for
debugging purposes.

I would expect that the onchange function should only fire when a
selection is made on either side AND the opposite > or < button is
pressed (moving the entry to the other side). However, whenever I
high-light an option in the left-hand box, it fires the onchange event.
Mind you, I haven't changed anything and the field.getValue/s()
functions still only return the data present in the right-hand side.
Has anyone else experienced this behavior? If so, was there a simple
fix to get around it?


--
ccohoon
------------------------------------------------------------------------
ccohoon's Profile: https://forums.netiq.com/member.php?userid=3429
View this thread: https://forums.netiq.com/showthread.php?t=51361

Labels (1)
0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: False Firing of the onchange Event for 2-List Picklist


Tested in UA 3.7, ie9 and ff30, same results as you report.

I have a function call that stores the data selected into a hidden field
with onchange.
If I put a form.alert() in the onchange it alerts at load time and on
every occurrence of a selection and click on left side.


--
gholdefe
------------------------------------------------------------------------
gholdefe's Profile: https://forums.netiq.com/member.php?userid=318
View this thread: https://forums.netiq.com/showthread.php?t=51361

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: False Firing of the onchange Event for 2-List Picklist

On 07/21/2014 03:14 PM, gholdefe wrote:
>
> Tested in UA 3.7, ie9 and ff30, same results as you report.
>
> I have a function call that stores the data selected into a hidden field
> with onchange.
> If I put a form.alert() in the onchange it alerts at load time and on
> every occurrence of a selection and click on left side.
>
>

Greetings,
What you have outlined is the expected behavior. That is why you
should add a condition check within your onchange code.

*Note this is free form as I am not near my designer*

var sValue = field.getValue();
//check to make sure there is a value
if (sValue){
//Check for a specific value
if (sValue == %something){
}

}


--

Sincerely,
Steven Williams
Lead Software Engineer
NetIQ
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.