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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:58:17+00:00 2026-05-28T13:58:17+00:00

I have this XAgent with seems to work fine but it opens it in

  • 0

I have this XAgent with seems to work fine but it opens it in the CURRENT browser. How would I open it in a new window?

This code is running in After RenderedResponse of an XPage.

Thanks

// Track Downloads

// Setup XAgent stuff
var exCon = facesContext.getExternalContext(); 
var writer = facesContext.getResponseWriter();
var response = exCon.getResponse();

var fileLink = param.get("link");

// Insert Logging Code here

facesContext.getExternalContext().redirect(fileLink);

writer.endDocument()
  • 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-28T13:58:18+00:00Added an answer on May 28, 2026 at 1:58 pm

    Looks like you are trying to track when somebody clicks on the download link.

    Without tracking the link would have been pointing directly at the file causing the browser to initiate the download and the user would stay on the current page. With the XAgent tracking in place the user is going to a different page in the application to do the tracking and initiate the download.

    You could add a target of ‘_blank’ to the initial link that is calling the XAgent. This will cause a new window/tab to open in the users browser but it will close once the download initiates.

    Using this method of tracking the downloads will, however, remove the ability for the user of the site to be able to right click on your download link and do a ‘save as’.

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

Sidebar

Related Questions

Have have this line of code in my form when I create a new
I have this code that I have written in Ruby, but when trying to
Have this upload script, and it works. But I would like to add a
I have this piece of code: WebClient web = new WebClient(); System.IO.Stream stream =
I have this query, which I know doesn't work, but I've left it as
I have this code ListItem item=new ListItem(); item.Text=foo; item.Value=1; ListItem item2=new ListItem(); item2.Text=bar; item2.Value=2;
Have this implementation file which compiles and runs fine, but gives me an unused
I have this code, but I get the error described in the title: The
I have this code to send variables to a datagrid on another page protected
I have this piece of code in one of my .jade files: each item

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.