This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem getting the values of a HtmlSelectManyCheckbox  RSS feed

 
Anu Sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Iam new to JSF and AJAX4JSF.

Iam tryign to get the selected values of HtmlSelctManyCheckbox using the binding component. but it is giving as null.
here is the code of my jsp and backing bean

in JSP


In backing bean im trying retieve the values using the binding component "courseInterestedInput" .but it is returning as null even though i selected the values in jsp.


Please help me to solve this.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"AS123499",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
Anu Sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestion.
Display Name has been updated.

Can anyone help me in giving a solution.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Anu S"

Please check your private messages.
 
Chandan Rajan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way to get the list of selected items is to call getCourseInterested(). Why aren't you doing that?
 
Anu Sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getCourseSelected() is not returnign selected values.
it just returns empty list
 
Chandan Rajan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put in a System.out.println in your setCourseSelected() and setCourseInterested(). Check if they are getting invoked.

If they are not getting invoked, then check if you have given the correct method names in your tags.

If the setters are getting invoked, check what value is getting passed. Also confirm if you are submitting the form with atleast one element selected.

Either case, look into your container log and check if there are any errors reported there.
 
Anu Sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

setCourseInterested is emptyinitially so i think it returns empty list anyway.

after selecting the values also, getCourseInterested() returns empty list.

if i use valueChangeListeners, then iam able to get the selected values list from geCourseInterested()
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!