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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:47:34+00:00 2026-06-06T15:47:34+00:00

I have tried <display:table name=jobTrackerCol pagesize=20 sort=list id=data requestURI= class=tablelist> <display:column title=Request Id sortable=true

  • 0

I have tried

<display:table name="jobTrackerCol" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">   
            <display:column title="Request Id" sortable="true" ><%-- property="request_id" > --%>   
            <a href=# onClick="popupSmallWindow('${data.query}');">${data.request_id}</a>   
            </display:column>   
</display:table>  

javascript

function popupSmallWindow(query){   
    //window.location="http://www.continue.com";    
    myString = query.replace(/[\r\n]/g, "<br />");    

    alert(myString);   
}

value in ${data.query} is long sql query.

I want to display that query in alert or new window when I click on the link.Please guide me on this

  • 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-06-06T15:47:35+00:00Added an answer on June 6, 2026 at 3:47 pm

    First of all, you’ll need to JavaScript-escape the query. Indeed, if you query is

    select a.id from a where a.name = 'doe'
    

    The resulting HTML code will be:

    onClick="popupSmallWindow('select a.id from a where a.name = 'doe'');"
    

    And this will obviously cause problems, because due to the unescaped single quotes, the JS code won’t be valid.

    You could use apache commons-lang StringEscapeUtils.escapeECMAScript() to do that.

    Now, an alert box doesn’t display HTML. SO you must not transform \r\n into <br/> if you want to display it in an alert box. Leave them as is, and the alert box will display the query just fine.

    If you want HTML support, you could use jQuery UI’s dialog box to display your SQL query. If you do, then replacing \r\n with <br/> would be needed. But you could do that in Java, and place your query in a hidden div that the jquery UI dialog box would use as the content of its dialog box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have one table where one column name is city. for every user i
I have a column called DayShift in a table which is of Yes/No data
Is there any way we can hide column of display table,we have media=none which
I have tried &nbsp;&nbsp; to display two spaces in a standard output Java String.
I am retrieving data from a SQL table so I can display the result
I have a table with threads for a forum, the thread name is a
I have tried using the code below to display ImageIcons in JTable. But when
I have the next code to display my countries table in a select box:
I have DB table with ~15,000 rows which I want to display in the
I have got table as given below in database: Name Grade Subject Ami HD

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.