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

  • Home
  • SEARCH
  • 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 947763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:07:59+00:00 2026-05-15T23:07:59+00:00

I am currently using displaytag for tabular data, but would like to create a

  • 0

I am currently using displaytag for tabular data, but would like to create a “kayak.com-like” interface where when a user clicks a row, the user is shown more details about the particular row without a page refresh.

For example, before clicking Details link on Row 1:

row1|col1|col2|col3|col4|Detail
row2|col1|col2|col3|col4|Detail
row3|col1|col2|col3|col4|Detail

After click:

row1|col1|col2|col3|col4|Detail
——–row1Detail—————
row2|col1|col2|col3|col4|Detail
row3|col1|col2|col3|col4|Detail

I tried using a decorator to return javascript that would do this. The javascript is executed, but it is only reflected in the column where it was rendered. I am looking to insert a new row with the data that does not affect displaytag’s pagination and sorting.

e.g.:

public class CustomDecorator extends TableDecorator {
   public String getDetailsRow() {
      MyObject object = (MyObject)this.getCurrentRowObject();
      return "<a onClick=\"myjsfunction(object.getId()); return true\">Details</a>";
   }
}

…and in the JSP I would have a detailsRow property nested between the display:table tags:

<display:column property="detailsRow" sortable="false" />

Any tips on how to insert a new row properly? The solution may be in the way that the javascript is written – I’m not an expert with Javascript, so any tips would be appreciated. Is there a better way to do this with displaytag? I don’t know of any explicit integration that displaytag has with javascript (like an “onclick” parameter) either.

This is my first question on stackoverflow, btw – so please let me know whether you need more detail.

  • 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-15T23:07:59+00:00Added an answer on May 15, 2026 at 11:07 pm

    Sorry to drag up an old question but here’s a possible solution incase anyone runs into this.
    When overriding TableDecorator, override the finishRow method to return your details row. This method will run after each row is written in the table, so for each real row, you’ll have a hidden row with the details in it

    public String finishRow() {
       return "<tr id='row1Details' style='visibility: collapse'><td colspan='500'>My Details</td></tr>";
    }
    

    Then you just have some javascript on the details column to set the hidden row to visible.

    Edit: Additional details:

    Add a new javascript function

    function displayDetails(id) {
       document.getElementById(id + 'details').style.visibility = 'visible'
    }
    

    Then your normal row would look something like:

    <tr id='row1'><td> .... </td><td><a href="#" onClick="displayDetails('row1')">Details</a></td></tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using displaytag to create reports. In the footer of the report i would
I am currently using Google Charts with PHP to populate the data but the
Currently using Google Analytics as a supplement to our paid tracking software, but neither
We're currently using WPF to create a multi-page invoice document, to then be printed
I am currently using the Html.EditorFor<> method for generating editor fields, however I would
Im using displaytag 1.2 and fmt tags: <%@ taglib uri=http://java.sun.com/jsp/jstl/fmt prefix=fmt %> <%@ taglib
i am having an issue, currently i am using cforms II and displaying a
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
Currently using MySQL version 5.1.6 This is my first real world build and so
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I

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.