• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selectManyCheckBox doesnt popolate the values selected

 
Kumar sat
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
 
H Jetly
Ranch Hand
Posts: 41
Google Web Toolkit Redhat Tomcat Server
  • 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 Redhat Tomcat Server
  • 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 Redhat Tomcat Server
  • 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 Redhat Tomcat Server
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic