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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:33:29+00:00 2026-06-10T09:33:29+00:00

I am creating web application using JSF 2.0 where I want to set checkboxes

  • 0

I am creating web application using JSF 2.0 where I want to set checkboxes to be selected when page loads.

<h:selectManyCheckbox value="#{UserRegistration.rightSelected}" id="myRight">
    <f:selectItem itemValue="add" itemLabel="Add"/>
    <f:selectItem itemValue="delete" itemLabel="Delete" />
    <f:selectItem itemValue="edit" itemLabel="Edit" />
</h:selectManyCheckbox>    

In this case, I want to set, Add and Delete checkbox to be selected by-default. How can I do this?

I tried with,

 <body onload="myRight:0:true">

Generate HTML content is

<td><table id="myRight">
<tr>
     <td>
     <input name="myRight" id="myRight:0" value="add" type="checkbox" checked="checked" />         <label for="myRight:0" class=""> Add</label></td>
     <td>
     <input name="myRight" id="myRight:1" value="delete" type="checkbox" checked="checked" /><label for="myRight:1" class=""> Delete</label></td>
     <td>
     <input name="myRight" id="myRight:2" value="edit" type="checkbox" checked="checked" /><label for="myRight:2" class=""> Edit</label></td>
</tr>

however it is not working.

Please suggest me how to get this done?

  • 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-10T09:33:31+00:00Added an answer on June 10, 2026 at 9:33 am

    if rightSelected is an array init your rightSelected as following

    private String[] rightSelected= {"add","delete"};
    

    if rightSelected is a List just do

    rightSelected.add("add");
    rightSelected.add("delete");
    

    or

    List<String> rightSelected = Arrays.asList("add", "delete");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
I am creating simple blog web application using play framework and i want to
I am creating a web application using ASP.NET MVC 4. I want to display
I am creating a web application using EJBs and servlets. I have a page
i am creating a web application using jsf and primefaces, and my question is
I'm creating a web based application using Java Server Faces (JSF). I'm just wondering
I'm creating a web application using ASP.NET MVC 4 and C#. I want all
I'm creating a web application installer using WiX. I want to allow the user
I am creating web application using jsf 2.0. I have command button where style
I am creating a web application using jQuery Mobile and I want to convert

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.