It's not a secret anymore!*
The moose likes Struts and the fly likes drop down menu usinng optionCollections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "drop down menu usinng optionCollections" Watch "drop down menu usinng optionCollections" New topic
Author

drop down menu usinng optionCollections

Namrta Pandey
Ranch Hand

Joined: Jul 22, 2008
Posts: 36
HI,

I have a List in my JSP which is coming from my hibernate query. It has only one column for example all the employee ids from the table. Now i want to show these emplyee ids in a drop down. I'm using optionCollections for the same but at runtime it is throwing an exception that no getter method for emp110(one of the emplyee code i.e. value in the list) under myForm bean has found.

Can anyone please tell me how can i show empids in drop down.

Thanks in Advance.

Namrta.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Namrta Pandey wrote: no getter method for emp110(one of the emplyee code i.e. value in the list) under myForm bean has found.

You, somewhere in your JSP code has written or set a property for "emp110" and the corresponding bean doesn't have a valid getter for that property !!

So check your JSP and the underlying bean for the required property !!

HTH


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Namrta Pandey
Ranch Hand

Joined: Jul 22, 2008
Posts: 36
emp110 is just a value which is coming as a result of query and it can be anything, so i anyway can't set any setter and getters for these values.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I repeat my first sentence:
You, somewhere in your JSP code has written or set a property for "emp110" and the corresponding bean doesn't have a valid getter for that property !!


that means, find out where you mistakenly declare a property attribute as "emp110".
Namrta Pandey
Ranch Hand

Joined: Jul 22, 2008
Posts: 36
I have not declared any setter or getter method for "emp110".
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

OK,
1. Either you found out that in you JSP page, you somewhere assiging a dynamic value to "property" attrbute
like

2. OR post your JSP, we will find out where this thing goes wrong.
Namrta Pandey
Ranch Hand

Joined: Jul 22, 2008
Posts: 36
Thanks Sagar , I have resolved the problem by fetching the whole record from database instead of fetching on empCode, son now its working fine.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I comment on this, because I didn't know how your code looks like,
Anyway, You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drop down menu usinng optionCollections