Close a popup Query (or any other window with focus)

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Close a popup Query (or any other window with focus)

Post by BLOMASKY »

I have a requirement, where I have a query that opens as a popup. There are operations with records, and after the process is run, I need this query popup to close.

I was not smart enough to figure this out, but John T, who is much smarter than me, better looking and has a cool tie! helped me, so let me share this incase others need this functionality.

At the end of my process I added an EXEC_SCRIPT with:

'let win = AwareApp.m_curPopupWindow; win.window.close ();'

Thanks John!
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Close a popup Query (or any other window with focus)

Post by customaware »

Nice one.

Had that problem since forever..
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Close a popup Query (or any other window with focus)

Post by customaware »

BLOMASKY wrote:I have a requirement, where I have a query that opens as a popup. There are operations with records, and after the process is run, I need this query popup to close.

I was not smart enough to figure this out, but John T, who is much smarter than me, better looking and has a cool tie! helped me, so let me share this incase others need this functionality.

At the end of my process I added an EXEC_SCRIPT with:

'let win = AwareApp.m_curPopupWindow; win.window.close ();'

Thanks John!
Is there an equivalent script for a form that is displayed in Default rather than a PopupWindow?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Close a popup Query (or any other window with focus)

Post by PointsWell »

This seems like a tips and tricks post

https://www.awareim.com/forum/viewtopic ... 553#p48553
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Close a popup Query (or any other window with focus)

Post by Jaymer »

Anyone know the code to close a regular form window.
(I'm NOT able to use the checkbox "Close form after save")

Using this, I get a runtime error:
"Exception running script TypeError: Cannot read property 'window' of undefined"

I would assume thats cause I don't have a popup, so it didn't find that object.

for popup: 'let win = AwareApp.m_curPopupWindow; win.window.close ();'
tried:
'let win = AwareApp; win.window.close ();' and
'let win = AwareApp.aware_app; win.window.close ();'
Error was: Cannot read property 'close' of undefined
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: Close a popup Query (or any other window with focus)

Post by johntalbott »

Is it a modeless form? Screenshot?
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Close a popup Query (or any other window with focus)

Post by Jaymer »

hi john,
just a regular form from a Create or Edit Object
Attachments
Screen Shot 2018-12-30 at 6.48.06 PM.png
Screen Shot 2018-12-30 at 6.48.06 PM.png (189.42 KiB) Viewed 8253 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Close a popup Query (or any other window with focus)

Post by Jaymer »

Basically, I ended up doing this:
EXEC_SCRIPT 'window.close ();'

That closed my newly opened browser tab the Landing Page appeared in after the user clicks on a link from the company's main website.
(Customer wants to request data, click on a link on Company Website, Aware page opens in new Tab via URL login to a VP, Form collects data, Save button saves form and runs Process to display Thank You, then closes the new Tab.)

Looked great, until I tried it on my iPad and the tab didn't close.
Decided to DISPLAY LAYOUT xxx from VP_xxx using static HTML, that says thanks, with a button that DISPLAY URL to Company Homepage.
User can then close the tab or continue if they wish.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply