Alpha Video Training
Results 1 to 3 of 3

Thread: How to close a window containing an a5w page or not open it in the first place???

  1. #1
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default How to close a window containing an a5w page or not open it in the first place???

    I've written some code to enter a new record into my database with an automatically issued number. I couldn't figure out how to run the code by itself with a button so I created an a5w page with it inside and I'm opening it with an onclickevent "Open an .a5w page, static HTML page, URL, or PDF document". Here's the code I need to run:

    Code:
    <%A5
    dim conn as sql::connection
    
    flag = conn.open("::Name::MVWKS")
    
    dim sqlCommand as c
    
    sqlCommand = "Select MAX(tnumber) from [tooling card info] where left(tnumber,1)='0'"
    
    flag = conn.execute(sqlCommand)
    
    dim rs as sql::ResultSet
    
    rs = conn.ResultSet
    
    dim next as n
    
    next=rs.data(1)
    next=next+1
    
    dim addzero as c
    
    addzero=next
    addzero="0"+addzero
    
    dim user as c
    
    user=upper(left(a5ws_getcurrentuser(),3))
    
    dim args as sql::Arguments
    
    args.add("nextnumber",addzero)
    args.add("drawnby",user)
    args.add("nowdate",now())
    args.add("fileloc","P:\Secured\ReleasedPDF\Tooling"+chr(92)+left(addzero,3)+chr(92)+addzero+".pdf")
    
    sqlCommand = "insert into [tooling card info] (tnumber, Revision, Drawn_by, Status, File_location, Department, File_type, File_ext, Last_edit_by, Issued) values (:nextnumber, '0', :drawnby, 'New Card', :fileloc, 'MFG ENG', 'SolidWorks', 'slddrw', :drawnby, :nowdate)"
    
    conn.execute(sqlCommand,args)
    
    args.clear()
    
    end 
    
    %>
    The code runs properly and does what I need it to do inside the a5w page but I CAN'T AUTOMATICALLY CLOSE the window afterwards. I've read on this forum that there is a problem with the usual methods of closing a window (close last opened window or close parent window) when your window contains an a5w page.

    Can anyone help me close this window automatically or is there another way to run the code without opening one in the first place?

  2. #2
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: How to close a window containing an a5w page or not open it in the first place???

    Nevermind. I finally found it. Make your "on click event" an Ajax callback and just put your a5w page in for the url but don't enter any action name or whatever. That fixes opening the window in the first place

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,865

    Default Re: How to close a window containing an a5w page or not open it in the first place???

    Cool... that'll come in handy... thanks.

Similar Threads

  1. Close a5w page in tabbed_ui
    By Peter.Greulich in forum Application Server Version 11 - Web/Browser Applications
    Replies: 13
    Last Post: 07-30-2012, 08:47 AM
  2. How to open a new a5w page in a Chrome TAB instead of a Chrome new window.
    By cptutrecht in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 05-14-2012, 05:47 PM
  3. a5w window close icon
    By frankbicknell in forum Application Server Version 10 - Web/Browser Applications
    Replies: 12
    Last Post: 04-29-2011, 11:32 AM
  4. how to place table fields into a5w page with background
    By aal_fareed in forum Application Server Version 10 - Web/Browser Applications
    Replies: 13
    Last Post: 04-11-2011, 03:16 AM
  5. Navigation System - Want to be able to open an a5w page in a pop-up window
    By envisionsolutions in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 06-23-2010, 05:32 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
  •