Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

rawValue from list box to text box

Avatar

Level 2

Hi all,

Can someone please tell me how I get the rawValue of a selected Item of a list box into a numeric field?

I have a button that pushes the selected entry to a text field. I would like to use the same button to populate the afferent numeric value of the same selected item to a numeric field.

 

Country.rawValue

=

Countries.getDisplayItem(Countries.selectedIndex);

This is what I have to get the displayed data.

What would the script be to get the rawValue fo the selcted Index?

Thanks a lot,

Larissa

1 Accepted Solution

Avatar

Correct answer by
Level 10

Instead of getDisplayItem() method, you use getSaveItem()

  

Nith

View solution in original post

3 Replies

Avatar

Level 10

Hi Larissa,

NumericField.rawValue = Countries.rawValue;

Will get you the rawValue (bound value) of the list box.

See here for an example: http://assure.ly/fYCuQ2.

Hope that helps,

Niall

Avatar

Correct answer by
Level 10

Instead of getDisplayItem() method, you use getSaveItem()

  

Nith

Avatar

Level 2

Thanks Nith and Niall for your help.

The getsaveitem is spot on!

I have one more question. Is it possible to associate more than 1 numeric value to an entry of a list box or drop down?

For example, let's say I have a country Algeria for which my cost is 100 USD but the additional cost for additional things is 50 USD.

Can I get the getsaveitem for both into two different fields? So, one saying Price and the other one saying additional price?

Thanks again!!

Larissa