• 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

Autocompleter - NoSuchMethodException

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, migrate from Struts 2.0.14 to 2.1.8.1 and have now problem with autocompleters in my project. See next example:

json.States:



json.CityCodes



struts.xml





and autocompleter.jsp



In action class I have method input, because I want preset value. In complex case, I want do it dynamicly but just this simple example doesn't work.

If I go to url /actionClass_input.action I have preseleced value in state autocompleter which is "Czech republic", but doesnt have key (in this case stateKey = 4). If you look into json.CityCodes.java, you may see setter for stateKey property. But in log I see warning:



But I don't send stateKey with String value, but with Integer. In next autocompleter (with city codes) I have not values for state "Czech republic" (see json.CityCodes and method getCityCodes()) - because stateKey is not set!

Next - on page in autocompleter.jsp I have debug prints - value[...] and key[...]. They print correct values if I get on url /actionClass_input:

value[state]: Czech republic
key[state]: 4


This autocompleter start work properly if I select value manually. But this is not user friendly.

In my previous version (Struts 2.0.14) it works correctly. I use for json "struts2-json-plugin" library with version 2.1.8.1 and "dojo-plugin" with same version.


Thank for your help!
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic