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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:56:11+00:00 2026-05-17T16:56:11+00:00

I am using the displaytag library to display a list of permission objects. The

  • 0

I am using the displaytag library to display a list of “permission” objects. The permission object contains an id, name, value, and associated application ID. When creating a “user group” one sets the name of the user group, the description, and selects the permissions to add to it by scrolling through the list in the displaytag table and checking the permissions desired with the checkbox.

The problem comes when I go to “edit” the user group. I want to load the displaytag table with the entire list of available permission objects, as I do on the create page, but I need to be able to set the “selected” value of the checkbox for the permissions that already exist for that usergroup.

My issue is how do I set the selected attribute on the checkbox. Is there some kind of “logic” functionality to the displaytag library where I can optionally set the selected attribute of the checkbox tag?

Below is the code as it is for the ‘creation’ of the UserGroup:

<display:table class="dataTable" defaultsort="1" name="userGroupForm.permissionList" id="tbldata" requestURI="/createUserGroup.do" pagesize="100">
    <display:setProperty name="paging.banner.onepage" value=""></display:setProperty>
    <display:column class="alignCenter" title=""><input type="checkbox" name="permIDs" value='<%=((Permission)pageContext.getAttribute("tbldata")).getPermissionCodeID() %>' /></display:column>
    <display:column class="alignLeft" property="permName" titleKey="label.name" sortable="true" />
    <display:column class="alignLeft" property="permValue" titleKey="label.value" sortable="true" />
    <display:column class="alignLeft" property="applicationName" titleKey="label.appname" sortable="true" />
</display:table>

So the idea would be, for the update page, to set the ‘selected’ attribute of the checkbox based on some property of the “permissionList” input data that I will set according to what permissions were already chosen for the UserGroup being updated.

I hope that was clear enough for rock and roll.

Thanks in advance for any insights 🙂

EDIT – I apologize, I believe the way to preselect the checkbox input element is to include the attribute “checked”, I had thought it was selected=”selected” or something like that.

  • 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-17T16:56:11+00:00Added an answer on May 17, 2026 at 4:56 pm

    This is how I solved it – I put an attribute in the ListObject to set if its been selected or not and pre set those values in the action before displaying the permission list:

                <display:table class="dataTable" defaultsort="1" name="userGroupForm.permissionList" id="tbldata" requestURI="/gotoUpdateUserGroup.do" pagesize="100">
                    <display:setProperty name="paging.banner.onepage" value=""></display:setProperty>
                    <% if (isAdmin == true) { %>
                    <display:column class="alignCenter" title="">
                    <input type="checkbox" name="permIDs" 
                           value='<%=((Permission)pageContext.getAttribute("tbldata")).getPermissionCodeID() %>' 
    
                           <%                            
                           String checked = "";
                           boolean selected = ((Permission)pageContext.getAttribute("tbldata")).getIsSelected();
    
                           if (selected == true) { checked = "checked"; } else { checked = ""; }
                           %>
    
                           <%= checked %> />
                    </display:column>
                    <% } %>
                    <display:column class="alignLeft" property="permName" titleKey="label.name" sortable="true" />
                    <display:column class="alignLeft" property="permValue" titleKey="label.value" sortable="true" />
                    <display:column class="alignLeft" property="applicationName" titleKey="label.appname" sortable="true" />
                </display:table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am integrating the displaytag library into my Spring MVC Application. I am using
We are using the Display tag library in our Java based web application. Apart
My application is using an image processing library to handle a long running task.
I recently started using the DisplayTag library and I've run into a problem. I'm
I'm creating a Windows Installer setup file using Wix and the standard UI library.
I have been using Freemarker for a while and found displaytag library very useful.
I am using the java displaytag library. I need to show the headers in
I'm using the DisplayTag library 1.2 and on the export all links are exported
When plotting oscillations in R, e.g., using the package desolve, df1 <-function(t,y,mu)( list(c(y[2],mu*y[1]^3-y[1]+0.005*cos(t)))) library
I am using display tag to render tables in my application. When I click

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.