| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
WebView.CreateWithControl
Creates a new web view inside the window with the given placeholder control.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| WebView | 10.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
MBS( "WebView.CreateWithControl"; WindowRef; ControlName { ; Version; DX; DY; Flags } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. | 0 | |
| ControlName | The name of the control on your FileMaker form. e.g. you can place a rectangle there to define the position. |
"mymedia" | |
| Version | The WebKit version you need. Pass 1 for WebKit 1.x or 2 for WebKit 2.x. Default is zero, which prefers WebKit 1 on MacOS. |
0 | Optional |
| DX | A delta to move view more to left or right. | 0 | Optional |
| DY | A delta to move view more to top or bottom. | 0 | Optional |
| Flags | Pass 1 to allow triggering scripts from JavaScript. Pass 2 to allow FileMaker.Evaluate in JavaScript. Pass 3 to allow both. Default is 0. Mac only as not implemented for IE. |
3 | Optional Added in version 16.2. |
Result
Returns OK or error.
Description
Creates a new web view inside the window with the given placeholder control.If you create WebKit 1.x view, you can use all the PDF/Image rendering functions, download delegate and callback functions, which don't work in WebKit 2.x.
But if you use WebKit 2.x, you can use script message handler or user scripts, which are not supported in WebKit 1.x.
The view is released automatically when window closes.
Web viewers created via WebView.Create or WebView.CreateWithControl are independent of FileMaker, so they don't reload with a record change. They also don't print with the layout and stay if you change the layout.
You can fmp: URLs and use FileMaker.PerformScript just like FileMaker's web viewer. For FileMaker.PerformScriptWithOption the option can be 1 for halt, 2 for exit, 3 for resume, 4 for pause. 0 is pause instead of continue and 6 is resume instead of Suspend and Resume since the plugin can't do these modes.
e.g. trigger a script:
FileMaker.PerformScript( "Script name", "Optional Parameter");
You can use FileMaker.Evaluate to directly evaluate something from JavaScript. e.g. query a get function like this:
let filename = await FileMaker.Evaluate('Get(FileName)');
Examples
Create Webviewer
#create with control on window
Set Variable [ $$web; Value:MBS("WebView.CreateWithControl"; 0; "placeholder"; 1) ]
Set Variable [ $r; Value:MBS( "WebView.LoadURL"; $$web; "https://www.monkeybreadsoftware.com/filemaker/") ]
Set Variable [ $$web; Value:MBS("WebView.CreateWithControl"; 0; "placeholder"; 1) ]
Set Variable [ $r; Value:MBS( "WebView.LoadURL"; $$web; "https://www.monkeybreadsoftware.com/filemaker/") ]
See also
- ImageView.CreateWithControl
- MapView.CreateWithControl
- Overlay.AddWebViewer
- Preview.CreateWithControl
- TextView.CreateWithControl
- WebView.Create
- WebView.LoadURL
- Window.FindByIndex
- Window.FindByTitle
- Window.SetCloseTrigger
Release notes
- Version 16.2
- Added flags parameter for Overlay.AddWebViewer, WebView.Create, WebView.CreateOnPopover, WebView.CreateWindow and WebView.CreateWithControl functions to control whether script triggers or Evaluate are allowed.
- Version 10.3
- Added WebView.CreateWithControl and WebView.SetFrameWithControl functions.
- Rewrote control placement for MacOS and iOS controls for AVPlayer.AddView, DragDrop.CreateWithControl, ImageView.CreateWithControl, MapView.CreateWithControl, TextView.CreateWithControl, WebView.CreateWithControl.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 16.2pr3
- Using PerformScript in a custom WebViewer in FileMaker
- New in version 11.5 of MBS FileMaker Plugin
- Neues MBS FileMaker Plugin 11.5 - Über 6600 Funktionen in einem Plugin
- MBS FileMaker Plugin 11.5
- Transitioning scripts for WebView2
- What is new in the MBS FileMaker Plugin Version 10.3
- Neues MBS FileMaker Plugin 10.3 - Über 6200 Funktionen in einem Plugin
- MBS FileMaker Plugin 10.3 - More than 6200 Functions In One Plugin
- MBS FileMaker Plugin, version 10.3pr3
This function checks for a license.
Created 9th June 2020, last changed 17th April 2026