?
Solved

Struts Display Table with dynamic columns on JSP

Posted on 2008-10-22
1
Medium Priority
?
10,742 Views
Last Modified: 2013-11-24
I'm trying to get a dynamic table to work with <display:table>, and I can't figure it out.

I've gotten this to work:
<table >                  
            <tr class="tableHeader">
      <logic:iterate id="element" name="QueryDefinition" property="colNames">      
                 <th><bean:write name="element" /></th>
      </logic:iterate>
            </tr>
                        
            <logic:iterate id="row" name="QueryDefinition" property="queryResult">
      <tr>
          <logic:iterate id="item" name="row" property="columns" indexId="index">
                   <td class="TableRowH" align="right" style="word-break:break-all"><bean:write name="item"/></td>
      </logic:iterate>
      </tr>
           </logic:iterate>
                        
</table>

but the table would look so much nicer if I could get it to work with <display:table>. I can get this far:

<display:table width="100%" align="bottom" name="QueryDefinition.queryResult" id="row" requestURI="ViewQueryList.do" class="tableHeader">                  
     <logic:iterate id="item" name="row" property="columns" indexId="index">
          <display:column><bean:write name="item"/></display:column>
     </logic:iterate>
</display:table>

But I can't get the column titles part to work, any ideas?

Thanks!
0
Comment
Question by:joycie237
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
joycie237 earned 0 total points
ID: 22791207
I figured it out:
<display:table name="QueryDefinition.queryResult" id="row" requestURI="ViewQueryList.do" class="tableHeader">                  
      <logic:iterate id="item" name="row" property="columns" indexId="index">
            <display:column title="${QueryDefinition.colNames[index]}"><bean:write name="item"/></display:column>
      </logic:iterate>
</display:table>
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question