Meaningless Drivel is fun!*
The moose likes Struts and the fly likes How to merge 2 columns in display tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to merge 2 columns in display tag" Watch "How to merge 2 columns in display tag" New topic
Author

How to merge 2 columns in display tag

aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
Hi,

I am using Struts 2 and display tag. I need to display something like this in one column:

From: <startDate> To: <endDAte>.

startDAte and endDate are coming from a DTO. How to achieve this in display tag. I also need to use different id's for startdate and end date column in display tag. Is that possible.

Here is the code i had written earlier using struts and html:

<td >From: <span id="startTimeSpan<s:property value="id"/>"><s:property value="startDate"/></span> - To:
<span id="endTimeSpan<s:property value="id"/>"> <s:property value="endDate"/></span></td>

Here for both spans, i am appending the id value so that id generated is unique.

Thanks in advance.

Aman Thind
SCJP,SCWCD
JAVA utte mar JAVA,mit JAVA
aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
If anybody is looking for similar thing, i used span and EL to achieve the soln.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to merge 2 columns in display tag
 
Similar Threads
sending form id to another action
Problem in hiding the row of data
iterate an object in struts-2
pagination problem
No getter method for property