opening eBase form in a non-modal popup window

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

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

opening eBase form in a non-modal popup window

#1

Postby Segi » Tue Dec 10, 2013 5:03 pm

I found a pretty easy way to display an eBase form in a popup window without using the iFrame method (which I don't think is practical for most situations and is overly complicated)

I cannot attach a zip file of my project here but have uploaded it to

http://www.sendspace.com/file/4vgie6

This is how I do it:

1. Add jQuery, jQuery UI and a jQueryUI plugin called PopupWindow to your form or presentation template (I'd recommend adding it to your presentation template so that it will be automatically included in any project that uses that template)

jQuery http://code.jquery.com/jquery-latest.min.js
jQuery UI http://code.jquery.com/ui/1.10.3/jquery-ui.js
popupWindow http://swip.codylindley.com/jquery.popupWindow.js

2. On your form add an HTML control with this code:

Code: Select all

<div id="popupdiv"
</div>
(*** Add the closing > at the end of <div id="popupdiv". When I put it in this post, it messes up the code ***)

This is the DOM element that will act as the parent of the popup window since we need to trigger the popup window from a DOM element.

3. Right click on the control that you want to click on to open the popup window and select HTML element properties.

Assign an id to the control and add a click event with this code. Change POPUPFORM in the line beginning with windowURL to the name of your eBase form.

Code: Select all

$&#40;'#popupdiv'&#41;.popupWindow&#40;&#123; 
	windowURL&#58;'ufsmain?formid=POPUPFORM',
	height&#58;500, 
	width&#58;500, 
	top&#58;50, 
	left&#58;50 
&#125;&#41;;

$&#40;'#popupdiv'&#41;.click&#40;&#41;;
0 x

User avatar
jcoulson
Ebase User
Posts: 30
Joined: Tue Sep 24, 2013 10:18 am
Location: Sandy, UK
Contact:

#2

Postby jcoulson » Fri Dec 13, 2013 3:11 pm

Hi Segi,

Good to see your solution works well. Ian asked me to let you know of a way that we have also achieved the same result of this without including any libraries. It only requires one line of javascript code:

Code: Select all

window.open&#40;url&#41;;
I looked into the library link you gave and it actually uses this code!

If you look at this link: http://www.w3schools.com/jsref/met_win_open.asp you can see how the configuration options can be passed into the method.

This approach means you do not need JQuery or any other libraries attached to the form or any DOM elements.

Hope this is helpful.

Jordan
0 x


Who is online

Users browsing this forum: No registered users and 11 guests