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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:35:48+00:00 2026-05-31T11:35:48+00:00

its me again. Basically Im checking the roles of a user once they hit

  • 0

its me again. Basically Im checking the roles of a user once they hit a page. Its an array, lets say 1,2,3. The contents of the last column on the jsp for testing has the role #’s that are attached to each individual attachment. The last column wont be on the finished product, but I need to do some sort of IF on that array to see if any of the values in the array:

<c:forEach items = "${hotPartRoles}" var = "hpRole"> 
    ${hpRole.id}
    </c:forEach>

are in the array of the attachment roles:

<c:forEach items = "${item.roles}" var = "role"> 
                    ${role.id}
                    </c:forEach>

jsp:

<table class="data_table">
<tr>
    <th>Attachments</th>
    //These are the user's Roles
    <c:forEach items = "${hotPartRoles}" var = "hpRole"> 
    ${hpRole.id}
    </c:forEach>

</tr>
<tr>
    <td class="subtable">
    <table class="data_table">
    <c:choose>
        <c:when test='${empty attachList}'>
           <tr>
              <td>No Attachments</td>
           </tr>
        </c:when>
        <c:otherwise>
            <tr>
                <th>Remove Attachment</th>
                <th>File Name</th>
                <th>File Type</th>
                <th>File Size (bytes)</th>
                <th>File Attached By</th>
                <th>Date/Time File Attached</th>
                <th>Roles</th>
            </tr>
            <c:forEach var="item" items="${attachList}" varStatus="loopCount">
                <tr>

                    <td class="button">
                    <rbac:check operation="<%=Operation.DELETE%>">
                        <button type="button"  onclick="javascript:delete_prompt(${item.id});">Delete</button>
                    </rbac:check>
                        </td>
                    <td><a href="show.view_hotpart_attachment?id=${item.id}">${item.fileName}</a></td>
                    <td>${item.fileType}</td>
                    <td><fmt:formatNumber value="${item.fileSize}" /></td>
                    <td>${item.auditable.createdBy.lastName}, ${item.auditable.createdBy.firstName}</td>
                    <td><fmt:formatDate value="${item.auditable.createdDate}" pattern="${date_time_pattern}" /></td>
                    <td>
                    <c:forEach items = "${item.roles}" var = "role"> 
                    ${role.id}
                    </c:forEach>
                    </td>
                </tr>
            </c:forEach>
        </c:otherwise>
    </c:choose>
    </table>

Now the arrays ont need to match exactly, just a value in the array of user roles is in the array of attachment roles….

I need to do the check here to determin whether or not to put a disable flag on the “delete” button:

 <rbac:check operation="<%=Operation.DELETE%>">
                        <button type="button"  onclick="javascript:delete_prompt(${item.id});">Delete</button>
                    </rbac:check>
                        </td>
                    <td>
  • 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-31T11:35:49+00:00Added an answer on May 31, 2026 at 11:35 am

    Doing 2 nested for loops and having a var set to false initially, then set to true and checking on that var seemed to work

       <c:forEach var="item" items="${attachList}" varStatus="loopCount">
                <c:set var="dispVal" value="false"/>
                <c:forEach items = "${item.roles}" var = "role"> 
                    <c:forEach items = "${hotPartRoles}" var = "hpRole"> 
                            <c:if test="${hpRole.id == role.id}">
                          <c:set var="dispVal" value="true"/>
                            </c:if>
                        </c:forEach>
                    </c:forEach>
    
                    <tr>
    
                        <td class="button">
                        <rbac:check operation="<%=Operation.DELETE%>">
    
                            <button type="button"<c:if test="${dispVal != 'true'}"> disabled="disabled"</c:if>  
                                onclick="javascript:delete_prompt(${item.id});">Delete</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello again stackoverflow... Once again I have a troublesome problem. I have a page
its me again with this project. im having a problem reading the text on
I am building a windows phone application (basically its a game but I am
I im developing a web application, its a servlet which basically acts as a
I am basically trying to get a user to input a hexadecimal input via
Im trying to deploy an app into Azure, its basically a completely fresh vanilla
I am once again looking for some help. I have found this stopwords script
I’ve created a little weekly trivia game for my website. Basically its five questions,
Basically i want to be able to get a 32bit int and attach its
Using the code at http://jsfiddle.net/eSbps/ I am having an issue. Basically its a menu

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.