auto close a form/browser window without user interaction

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

auto close a form/browser window without user interaction

#1

Postby neilnewman » Fri May 08, 2015 2:29 pm

I have an Ebase form that is being called by a Powershell script on a regular basis.
Is there a way to auto close the form/browser window once it has completed without user interaction.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri May 08, 2015 3:03 pm

You need to run some Javascript on the client to close the window, something like window.close(), but I think there are some technical issues with this. From an Ebase point of view, you could set up a new page, add an HTML control containing:

Code: Select all

<script type="text/javascript">
    window.close&#40;&#41;;
</script>
then just go to the new page.

But as I said above, you may find that window.close() doesn't do the job for some reason. You may need to google the exact Javascript to use.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#3

Postby Segi » Fri May 08, 2015 8:05 pm

I do something very similar to what Jon suggested. I put an HTML control on the page that I want to close and don't enter any HTML at the time that I add it to the page. When it is time to close it, I do something like this in the JavaScript event:

Code: Select all

control.CLOSEWINDOW.htmlText.setText&#40;'<HTML><BODY><SCRIPT>window.close&#40;&#41;;</SCRIPT></BODY><HTML>'&#41;;
This will immediately close the window
0 x

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

Thanks for the pointers

#4

Postby neilnewman » Sun May 10, 2015 8:31 am

I got it to work with the following code:
<script>
window.top.close();
</script>

Many thanks
Neil
0 x

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

#5

Postby HarryDeBoer » Mon May 11, 2015 11:44 am

another (Ebase) way of doing this is by using the Ebase scheduler with the form runner if you don't have user interactions.
0 x
Kind regards,

Harry

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#6

Postby Steve James » Fri May 15, 2015 11:20 am

Just another approach.

We have a series of .net web services (outside of Ebase) that integrate various systems.
We have some Ebase form writers who needed a mechanism to regularly call Ebase forms that don't require human interaction. We were using Ebase scheduler but support for using multiple approaches was problematic.

Solution, we have a .net web service that calls Ebase forms via HttpWebRequest/HttpWebResponse (could equally well be Powershell Invoke-WebRequest).

The issue was that the response was only the browsercheck web page and the actual form wasn't being called, as we have an Ebase 'intergration' environment we were able to set Ufs.skipBrowserAttributesCheck=true which means the actual form is called without browser and the web service can interrogate the response and process accordingly.
0 x


Who is online

Users browsing this forum: No registered users and 21 guests