Expand my Community achievements bar.

New drop down value not reflected in change event

Avatar

Former Community Member
I have a drop down like so....



Label Value

"Selection 1" 1

"Selection 2" 2



However, in the change event, the rawValue is always the prior value, not the newly selected one. xfa.event.newText will give me the newly selected label but I need the newly selected value.



For example, if the current selection is "Selection 1" and I select "Selection 2", the value of rawValue will be 1 while the value of newText will be "Selection 2".



For kicks, I checked in the change event for a radio button group and I do get the new value.



Is this a bug ?
3 Replies

Avatar

Former Community Member
Rob_Gabbard@adobeforums.com wrote:

> I have a drop down like so....

>

> Label Value

> "Selection 1" 1

> "Selection 2" 2

>

> However, in the change event, the rawValue is always the prior value, not the newly selected one. xfa.event.newText will give me the newly selected label but I need the newly selected value.

>

> For example, if the current selection is "Selection 1" and I select "Selection 2", the value of rawValue will be 1 while the value of newText will be "Selection 2".

>

> For kicks, I checked in the change event for a radio button group and I do get the new value.

>

> Is this a bug ?



Rob,

I agree it's kinda goofy the way it works, but I don't think it's a

bug. To get the value you want, you need to do the following:



var newtext = xfa.event.newText;

var newvalue = this.boundItem(newtext);





Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
Thanks Justin,



You Cardinal guys are so smart :)



Rob

Avatar

Former Community Member
I don't think it's a bug - I believe the change event does not actually commit the new selection values until you tab out or move out of the drop down list (or make another selection), so until you do so, the rawValue will still be set to the previous selection (one before what is currently highlighted).



If you put an app.alert(DropDownList1.rawValue) on the exit event of the drop down list, you will get the rawValue of that latest selection. (If you put it on the change event, you'll be the value of the previous selection, like you observed.)



Hope this might help,



Lynne