• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Problem with html:select - Cannot find bean

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I try to put a select box with some option tags, I am getting "Cannot find bean under name CustomerNames" error. I have searched the forum and im not able to solve it.


<html:select name="CustForm" property="selCustName" multiple="true" size="10">
<html ptions collection="CustomerNames" property="custName" labelProperty="id"/>
</html:select>


I am having a customer form which has a arraylist CustomerNames. This arraylist has customer bean which has proeprties custName and id. The custForm also has a String[] selCustName.

Please let me know what am I doing wrong here.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for this one, I'd recommend using the optionsCollection tag, rather than the options tag. Here's the link for the user documentation on this:

http://struts.apache.org/struts-doc-1.2.8/userGuide/struts-html.html#options

so, for your example, the tag would be:

<html:optionsCollection property="CustomerNames" value="custName" label="id"/>
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. I tried by using that. But still getting the same error. "Cannot find bean under name CustomerNames".
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. I tried by using that. But still getting the same error. "Cannot find bean under name CustomerNames".
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try specifying name="custForm" property="CustomerNames"
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot I got it!! Without specifying form name itself it is coming..previously there was some uncommented code. So I got the same error again.

Thank you again!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic