Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

selectManyCheckBox doesnt popolate the values selected

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

I am newbee to JSF, facing a issue with the selected values.

Here is the scenario.

I have List of objects which i am populating in the .XHTML file.

<h:selectManyCheckbox value="#{srchDev.osSelected}">
<f:converter converterId="utilConverter" />
<f:selectItems value="#{srchDev.osList}" />
</h:selectManyCheckbox>

In the backing bean i have

private List<OS> osList;
private List<OS> osSelected;


In the converter

i am wondering on how the get the values selected.
In getAsObject method,
value of the String just returns "on".

How do i get the actual selected string or value and convert to an object.

Any examples will be really helpful

Thanks
s
 
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As far as I know

takes a list of type SelectItem



and
the value will have to map to a string





Try modelling the solution like this it will help.

You would not have to use the converter then.
 
Kumar sat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

But if we select multiple check box how would this get into the single String value i.e. private String osSelected?

Thanks

s

H Jetly wrote:Hi,
As far as I know

takes a list of type SelectItem



and
the value will have to map to a string





Try modelling the solution like this it will help.

You would not have to use the converter then.

 
H Jetly
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that,
select One List Box, ya you are going in the right direction the only thing is


will change to
 
H Jetly
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one question, why did you try to use a converter? Was it required in this case.
 
Kumar sat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently, this is what i am trying to do, but its not getting the selected values into the list.

The populated list for the check box returns the objects.

I am looking for some good examples but finding any?

-s


H Jetly wrote:Sorry about that,
select One List Box, ya you are going in the right direction the only thing is


will change to

 
H Jetly
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this link it will help you
http://www.exadel.com/web/portal/jsftags-guide
 
Die Fledermaus does not fear such a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!