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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:13:41+00:00 2026-06-07T20:13:41+00:00

I am building a web application in Play! 1.2.5. I have a model class

  • 0

I am building a web application in Play! 1.2.5. I have a model class where one of the attributes is a Set collection of enums:

@Entity
@Table(name="AppUser")
public class User extends Model {

    ...

    @Column(name = "industry_id")
    @ElementCollection(targetClass = Industry.class)
    @CollectionTable(name = "Industry", joinColumns = @JoinColumn(name = "AppUser_id"))
    public Set<Industry> industries = new HashSet<Industry>();

}

The enum is:

public enum Industry {
    Industry1,
    Industry2
}

How exactly can I bind the industries collection to an edit template where the industries field is represented as a list of checkboxes, and their checking or unchecking adds them or removes them from the objects collection?

Thany you

  • 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-07T20:13:42+00:00Added an answer on June 7, 2026 at 8:13 pm

    You can bind your checkboxes like this

    #{form @save()}
    <input type="checkbox" value="Industry1" name="user.industries">Industry number 1
    <input type="checkbox" value="Industry2" name="user.industries">Industry number 2
    <input type="checkbox" value="Industry3" name="user.industries">Industry number 3
    <input type="submit" value="Submit">
    #{/form}
    

    In my case it works on a model without JPA annotations but I guess it also work in your case

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

Sidebar

Related Questions

I am building a web application and have been told that using object oriented
I building a web application in ASP.NET 3.5 and C#. I have a method
I have an existing web application which I have been building with an ant
I'm building a web application where I have 2 sets of users (students and
I have been asked to build a small web application for one of our
I am building a web application as college project (using Python), where I need
I am building a web application (in Django, though this isn't a Django-specific question).
I'm building a web application where all database connectivity is done through a proxy
I'm building a web-application in JavaScript using the dojo framework. I want to create
I am building a Web Application using asp.net (C#). I come from windows forms

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.