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!
Close a popup Query (or any other window with focus)
-
- Posts: 2391
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Close a popup Query (or any other window with focus)
Nice one.
Had that problem since forever..
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....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
-
- Posts: 2391
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Close a popup Query (or any other window with focus)
Is there an equivalent script for a form that is displayed in Default rather than a PopupWindow?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!
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Close a popup Query (or any other window with focus)
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
(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
Jaymer
Aware Programming & Consulting - Tampa FL
-
- 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)
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
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Re: Close a popup Query (or any other window with focus)
hi john,
just a regular form from a Create or Edit Object
just a regular form from a Create or Edit Object
- Attachments
-
- 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
Aware Programming & Consulting - Tampa FL
Re: Close a popup Query (or any other window with focus)
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.
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
Jaymer
Aware Programming & Consulting - Tampa FL