Alpha Video Training
Results 1 to 6 of 6

Thread: response.redirect w/ target

  1. #1
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,843

    Default response.redirect w/ target

    Is it possible for a WAS page to set a target (e.g. target=_blank) as part of response.redirect()? I find comments on the web that this is difficult to accomplilsh.

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,308

    Default RE: response.redirect w/ target

    no you can't.

    response.redirect is used to tell the current window what to display.

    remember, the current window has to display SOMETHING.

    also, remember, only the user (or javascript that runs on the user's browser) can cause a new browser window to open. the server cannot cause a new window to open on the client. response.redirect is a server command.

    this is not a limitation, and it is not unique to a5. it would be true no matter what tool you were using - e.g. asp, coldfusion, etc.

  3. #3
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: response.redirect w/ target

    A response.redirect cannot do this. The reason is that a specific window has requested a page (which in this case is being redirected to a different page) and the result can only be sent to the page which made the request.

    What you are trying to achieve can be done, but it is a bit complex. Something must be sent back to the window which made the request. I don't know what you want to display there, but probably just the same page. In this page that you send back, you would also need to include some javascript code that opened a new window and in that window made the request for the actual page you are trying to open. Take a look at the onLoad event for the BODY and Javascript's window.open()

    -Lenny

  4. #4
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,843

    Default RE: response.redirect w/ target

    Thanks, I'll play around with it. I've used onload and window.open javascript in the past (through Dreamweaver) to open a new browser window. I can see why it is difficult to program, and its not urgent, but wanted to add this point below...

    I think it is important at the 'presentation level' for users to expect reports to open a window other than the WAS application window. Users get lost as they spend time with the report -- analysis, printing, reading, etc. When done they do the natural thing and close [X] the report, thereby closing the Alpha application. More often, users want to compare information in the report side-by-side with something in the WAS application; perhaps change some parameters, and then run the report again. This is a useful feature of Alpha's non-WAS reports, which open in a new print-preview window.

  5. #5
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: response.redirect w/ target

    Steve, this could actually be quite easy to accomplish then because you don't need the redirect to open the page. Assuming you've created your app similar to the Web App Demo page (http://was.alphasoftware.com/web_applications_demo/default/Orders_wItems.a5w), all you need to do is change your hyperlink for the report. Your
    "a href="report.a5w?invnum=123">
    would become something like
    "a onClick="window.open('report.a5w?invnum=123','new_window_for_reports')>

    -Lenny

  6. #6
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: response.redirect w/ target

    Lenny's example is for a link, not a response.redirect(). If you want to use a link, then it's a snap to open a new window without using javascript. Just follow the examples of how links are created for grids, which allow you to open links in new target pages. I use code something like this at the bottom of a page:

    "%a5 link=""a href=\"PrintOptions.a5w?recno="+\
    recno+"\" target=\"_blank\""Print Options"/a""
    ? ""br""+link
    %"

    which opens the PrintOptions.a5w page in a new browser window.

Similar Threads

  1. date picker onchange for target
    By tojo in forum Archived Wishlist
    Replies: 1
    Last Post: 08-30-2005, 08:33 PM
  2. Target Page and GridLinker problem
    By Brett in forum Web Application Server v6
    Replies: 3
    Last Post: 07-06-2005, 07:12 AM
  3. Scaling web page sizes using response.redirect()
    By PCS in forum Web Application Server v6
    Replies: 0
    Last Post: 06-21-2005, 02:46 PM
  4. Keeping record pointers on target
    By Stephen Williams in forum Alpha Five Version 4
    Replies: 15
    Last Post: 03-28-2001, 02:09 PM
  5. Lookup pads the target field with blanks
    By Doug Chanley in forum Alpha Five Version 4
    Replies: 0
    Last Post: 01-06-2001, 12:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •