Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8111287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:03:40+00:00 2026-06-06T02:03:40+00:00

I have created checkboxes. When I selected multiple checkboxes then how can I get

  • 0

I have created checkboxes. When I selected multiple checkboxes then how can I get those multiple selected checkboxes value? my code is:

<h:selectManyCheckbox id="chkedition" value="#{adcreateBean.editionID}" layout="lineDirection" styleClass="nostyle">
<f:selectItems value="#{adcreateBean.editions}" var="item" itemLabel="#{item.editionName}" itemValue="#{item.editionID}"/>
</h:selectManyCheckbox>

I have taken value=”#{adcreateBean.editionID}” ,so it returns single value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:03:41+00:00Added an answer on June 6, 2026 at 2:03 am

    The value of the <h:selectManyXxx> component needs to point to an array or List of the very same type as the itemValue. Assuming that it’s Long, then it needs to be bound to a Long[] or List<Long>.

    E.g.

    private Long[] selectedEditionIds; // +getter +setter
    private List<Edition> availableEditions; // +getter
    

    with

    <h:selectManyCheckbox value="#{bean.selectedEditionIds}">
        <f:selectItems value="#{bean.availableEditions}" var="edition" itemLabel="#{edition.name}" itemValue="#{edition.id}" />
    </h:selectManyCheckbox>
    

    If you prefer a List<Long>, then you should explicitly supply a converter for the Long type, because generic types are erased during runtime and without a converter EL would set String values in the List which would ultimately only result in ClassCaseExceptions. Thus so:

    private List<Long> selectedEditionIds; // +getter +setter
    private List<Edition> availableEditions; // +getter
    

    with

    <h:selectManyCheckbox value="#{bean.selectedEditionIds}" converter="javax.faces.Long">
        <f:selectItems value="#{bean.availableEditions}" var="edition" itemLabel="#{edition.name}" itemValue="#{edition.id}" />
    </h:selectManyCheckbox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE ON THIS: I can get to alert the checkboxes selected but I'm having
I have created a gridview with a column of checkboxes. I want the user
I have a created a following renderer which renders the JTree with checkboxes and
I have created a file with XmlDocument xmldoc = new XmlDocument(); Can I make
I have a list of categories paired with checkboxes. I can't find any documentation
I have some checkboxes in vb.net code. <tr> <td colspan=2> <asp:CheckBox ID=chkbxCreateAmendOrg runat=server Checked=False
I have created customized combobox which extends JCombobox. It is having checkboxes in popup
I have a form field (a series of checkboxes) that's being created dynamically from
I have a ListView with multiple checkboxes (one for each list item). What would
I have created a Treeview and used a stack panel to include a checkbox,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.