• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 getting key/value pairs

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi ranch experts,

I need you...................

I am using struts 2 framework, the problem is i want to get a auto completer id(1,2,3,4) instead of getting value (apple,banana.....).

The code works fine, it gets only (apple,banna..........) but i want to get the id(1,2..............)

function getFruits(fruits){
alert(fruits);
}
function registerFruits(){
var fruits = dojo.widget.byId('fruits');
dojo.event.connect(fruits, 'onValueChanged', 'getFruits')
}
dojo.addOnLoad(registerFruits);

<s:autocompleter name="test" list="#{'1':'apple','2':'banana','3':'grape','4':'pear'}" autoComplete="false" id="fruits"/>

Is there any way to get the id(key)
Expecting your suggestions...............
Thanks in advance,
Regards Gopi.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic