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 8049637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:50:18+00:00 2026-06-05T06:50:18+00:00

i have renderd checkboxes. when i select checkbox that checkbox value shoud be displayed

  • 0

i have renderd checkboxes. when i select checkbox that checkbox value shoud be displayed in panel.i have written code for this but not worked

                              <h:selectManyCheckbox id="chkedition" value="#{newspaperBean.selectedEditions}" layout="lineDirection" styleClass="nostyle">
                                  <f:selectItems value="#{newspaperBean.searchEditionByNewspaper()}" var="item" itemLabel="#{item.editionName}" itemValue="#{item.editionName}"/>
                                  <f:ajax render="display" event="select"/>
                              </h:selectManyCheckbox>
                          </td>
                        </tr>
                            <tr>
                                <td colspan="2">
                                    <p:panel id="display" header="You have selected">
                                    <c:forEach items="#{newspaperBean.selectedEditions}" var="it">
                                        <h:outputText value="#{it}"/><br/>
                                    </c:forEach>
                                    </p:panel>
                                </td>
                            </tr>

this worked when i submit form but i want that when i select checkbox.

  • 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-05T06:50:20+00:00Added an answer on June 5, 2026 at 6:50 am

    Remove the event="select" attribute. This is the incorrect event to hook on. It’s only triggered when you select any text in input fields and textareas, not when you click the checkbox.

    <f:ajax render="display" />
    

    The default event is already valueChange which will resolve to click in checkboxes and this is exactly what you need. You can if necessary explicitly specify it by event="click", but as said, it’s the default value already, so just omit it.

    Another potential problem is the <c:forEach> in the panel. This will fail if the bean is view scoped because it runs during view build time and get its own separate instance of the view scoped bean which may not contain the submitted data. You’d need to use <ui:repeat> instead.

    <ui:repeat value="#{newspaperBean.selectedEditions}" var="it">
        <h:outputText value="#{it}"/><br/>
    </ui:repeat>
    

    See also:

    • JSTL in JSF2 Facelets… makes sense?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a panel that has lots of labels and checkboxes. I want to
I have a mini form that consists of all select boxes and checkbox lists.
Can I send Ajax update commands to JSF components that have not been rendered
Basically I have a set of checkboxes that are dynamically created from view data
I have a Datalist which renders a list of checkboxes and value attributes on
I have a event model that has many invitations. Invitations are setup through checkboxes
Alright I know that the .closest() have been discussed before, but I have been
we have an requirement where all the products are displayed with the checkbox next
I've looked at this which seems to have no effect on my code. I've
I have an MVC view model that looks like this: public class DirectorySearchModel {

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.