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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:19:40+00:00 2026-05-23T11:19:40+00:00

in order to select the data i want to remove i put a selectbooleanCheckbox

  • 0

in order to select the data i want to remove i put a selectbooleanCheckbox in each row of my dataTable, But the checkbox doesn’t change state and it’s always set to false even if i select the row (it works fine outside the dataTable).
here’s my backingBean:

    public class PermissionCtrl {

    //some attributes
    private UIData datas;
    private List<Permission> permissions;


    private UISelectBoolean checkbox ;

    @EJB
    private PermissionEjbLocal permissionService;


     //getters & setters


    public List<Permission> getSelectedPermissions() {

    Permission selectedRow = new Permission();
    int size = datas.getRowCount();

    List<Permission> selectedPermissions = new ArrayList<Permission>();
    for (int i = 0; i < size; i++) {
        datas.setRowIndex(i);
        System.out.println(i);
        System.out.println(checkbox.isSelected());
        if (checkbox.isSelected()) {

            selectedRow = (Permission) datas.getRowData();
            selectedPermissions.add(selectedRow);

        }

    }
    return selectedPermissions;
}

public String removeAction() {

    List<Permission> selectedPermissions = getSelectedPermissions();
    for (Permission p : selectedPermissions) {

        permissionService.removePermission(p);
    }
    this.permissions =  permissionService.getAllPermissions(); 

    return null;
}
    }

and this is the dataTable where i get the data:

    <ice:form>
    <ice:dataTable binding="#{permissionCtrl.datas}" value="#{permissionCtrl.permissions}" var="p">
            <ice:column>
                <f:facet name="header">
                    <ice:outputText value="select" />
                </f:facet>
                <ice:selectBooleanCheckbox binding="#{permissionCtrl.checkbox}"  />
            </ice:column>
            <ice:column>
                <f:facet name="header">
                    <ice:outputText value="ID" />
                </f:facet>
                <ice:outputText value="test" />
            </ice:column>
            <ice:column>
                <f:facet name="header">
                    <ice:outputText value="Label" />
                </f:facet>
                <ice:outputText value="#{p.label}" />

            </ice:column>

            <ice:column style="width:150px">
                <f:facet name="header">
                    <ice:outputText value="Url" />
                </f:facet>
                <ice:outputText value="#{p.url}" />

            </ice:column>


            <ice:column style="width:300px">
                <f:facet name="header">
                    <ice:outputText value="Description" />
                </f:facet>
                <ice:outputText value="#{p.description}" />

            </ice:column>
        </ice:dataTable>
    </ice:form>

did anyone ran into a similar issue? are there any errors in my code?

  • 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-05-23T11:19:41+00:00Added an answer on May 23, 2026 at 11:19 am

    what you have done is.. for all object you are binding with same variable,so the result would be last selection item.it would get overwrite till all objects arrived.

    Solution is ::

    make one persistent boolean property in Permission class like isSelected

    put value with property like

    <ice:selectBooleanCheckbox binding="#{permissionCtrl.checkbox}" value="#{p.selected}"/>
    

    you will get value true or false in checkbox property in backing bean.

    public List<Permission> getSelectedPermissions() {
    
        Permission selectedRow = new Permission();
        int size = datas.getRowCount();
    
        List<Permission> selectedPermissions = new ArrayList<Permission>();
        for (int i = 0; i < size; i++) {
            datas.setRowIndex(i);
            selectedRow = (Permission) datas.getRowData();
            if (selectedRow.isSelected()) {
                selectedPermissions.add(selectedRow);
            }
        }
        return selectedPermissions;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY hrl.Frn) as Row, hrl.unq, hrl.LcnsId, hc.Business,hc.Name,hc.Phone,
I want to put a condtion to sort SQL data based on the value
I have a query that outputs address order data: SELECT ordernumber , article_description ,
im trieng to select data from 3 diffrent tables, i want to select the
I have a table with purchased orders data. Each row contails the amount of
i have three tables, i want to select all data from one of the
Here is my desired transaction order: User1 select field, perform operation, update with new
In DB2, you can name a column ORDER and write SQL like SELECT ORDER
I'm trying to select the order total sum ($) and invoice count over a
What is copyright licence type to select in order to make the code free

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.