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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:49:34+00:00 2026-06-18T07:49:34+00:00

I have the following (note that I am using the spring convention by prefixing

  • 0

I have the following (note that I am using the spring convention by prefixing with underscore):

<input type="checkbox" name="speakersIds[${speaker.id}]"  value="true"  />
<input type="hidden" name="_speakersIds[${speaker.id}]" value="false" />

speakersIds is a map property of my model.

Map<Long, Boolean> speakersIds;

The problem is that in my controller, unchecked checkbox are not set to false.

Example:

if speakersIds[0] was checked, then speakersIds.get(0) == true

if speakersIds[0] was not checked, then speakersIds.get(0) == null. <— shouldn’t this be == false?

Why?

  • 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-18T07:49:36+00:00Added an answer on June 18, 2026 at 7:49 am

    In case of map, the underscore convention do not seem to work.

    I finally just used the same property name in the hidden input.

    <input type="checkbox" name='speakersIds["${speaker.id}"]'  value="True" />
    <input type="hidden" name='speakersIds["${speaker.id}"]' value="False" />

    While testing I had to change the type of speakersIds from Map<Long, Boolean> to Map<String, Boolean> but it should work with long as map key too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object called Person that has the following properties: int id; Name
I have following code that I am using for export to excel of a
I have the following HTML code (note no closing tags on <\option> ) generated
I have the following query: tblVAL tblval = db.tblVALs.Where(p => p.PID == pid); Note
I have following script that executes all the .reg files in the current directory.
I have following nested objects. I am using @Valid for validation in my controller.
I'm using Spring Security in Grails to restrict access to my controllers. I have
We have been using Spring Remoting in our project for sometime. It is used
I have the following table created using Entity Framework Code First approach. How do
I have the following code on WCF Service and I am using basicHttpBinding public

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.