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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:26:45+00:00 2026-06-06T04:26:45+00:00

Can someone please explain this phenomenon? I am using Mojarra 2.1.6 – Glassfish 3.1.2.

  • 0

Can someone please explain this phenomenon?

I am using Mojarra 2.1.6 – Glassfish 3.1.2.

I have a checkbox inside a ui:repeat. The ui:repeat is looping over a list of booleans from my managed bean. Each individual checkbox is bound to an element of that list. For example:

<ui:repeat var="checkbox" value="#{checkboxTestBean.list}" varStatus="status">
  <h:selectBooleanCheckbox value="#{checkbox}"/>
</ui:repeat>

The problem is the values aren’t getting applied to the managed bean. When I submit and re-render the form, the values don’t stick.

However, if I index into the managed bean element explicitly, by changing value=#{checkbox} above to value="#{checkboxTestBean.list[status.index]}", everything works.

Any ideas why that might be the case?

XHTML:

<h:form>
<div>
Using value="#\{var\}"
<ui:repeat var="checkbox" value="#{checkboxTestBean.list}" varStatus="status">
    <h:selectBooleanCheckbox value="#{checkbox}"/>
</ui:repeat>
</div>

<div>
Using value="#\{varStatus.index\}"
<ui:repeat var="checkbox" value="#{checkboxTestBean.list}" varStatus="status">
    <h:selectBooleanCheckbox value="#{checkboxTestBean.list[status.index]}"/>
</ui:repeat>
</div>
<h:commandLink actionListener="#{checkboxTestBean.actionListener}">
PROCESS FORM
    <f:ajax execute="@form" render="@form"/>
</h:commandLink>
</h:form>

Java:

@ManagedBean
@ViewScoped
public class CheckboxTestBean {

public List<Boolean> list = new ArrayList<Boolean>();

public CheckboxTestBean() {
    for (int i = 0; i < 5; i++) {
        list.add(Boolean.FALSE);
    }
}

public void actionListener(ActionEvent evt) {
    System.out.println("*** dumping whole form");
    System.out.println("*** list = " + list);
}

public List<Boolean> getList() {
    return list;
}

public void setList(List<Boolean> list) {
    this.list = list;
}
}
  • 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-06T04:26:47+00:00Added an answer on June 6, 2026 at 4:26 am

    That’s because the Boolean as being an immutable class doesn’t have a setter method for the value. When referencing it as a list item by index instead, EL will be able to set the new value on the List by index like so list.add(status.index, newValue). An alternative is to make it a property of a mutable model class and have a collection of it instead like so List<Item> which you reference by <h:selectBooleanCheckbox value="#{item.checkbox}"/>.

    This is not specifically related to Boolean, you would have exactly the same problem when using for example List<String> in an <ui:repeat><h:inputText>.

    See also:

    • Using <ui:repeat><h:inputText> on a List<String> doesn't update model values
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a feeling this XML is not valid, can someone please explain why?
Can someone please explain why this works. Here is the scenerio. I have a
I have regex which reads: @<img\s*[^>]*>(?:\s*?</img>)? Can someone please explain this part: (?:\s*?)? What
Can someone please explain this to me? I have the following code: <form action=<?php
Can someone please explain this piece of code which I have tried to decipher?
Can someone please explain to me how this responsive approach works? This was done
Can someone please explain why I'm getting this error Type mismatch: cannot convert from
Could someone please help explain why I can't get this to work? I properly
Can someone please explain why this code is not outputting a value for $consultant
Can someone please explain why this test fails: [Fact] public void ResolveAllDoesNotReturnServicesRegisteredInParent() { //

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.