WebView.HasParent
-----------------

Checks whether WebView has parent control.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [12.1](newinversion121.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.HasParent"; WebViewerRef ) 

**MBS**( **"WebView.HasParent";** /\* Checks whether WebView has parent control. \*/  
**$WebViewerRef**) /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |

### Result

Returns 0, 1 or error.

### Description

Checks whether WebView has parent control.  
When you use custom WebViewer with our plugin, you may run into the situation, that FileMaker rebuilds the layout (e.g. after changing a value list!). Then WebView.HasParent will return 0 and you know the WebViewer got removed by FileMaker.   
So when you have a script triggered by user going to new layout, you can check the status of web viewer and if needed rebuild it. Or change workflows, so if user needs to change a value list, they may need to open a card window then reach the edit dialog and when they click back button to close card, you can reload WebViewer.  
### Examples

Whether browser has a parent:

 Set Variable \[ $hasParent ; Value: MBS ("WebView.HasParent"; $$web ) \]  
### See also

- [WebView.FindByName](WebViewFindByName.md)

### Release notes

- **Version 12.1**
    - Added [WebView.HasParent](https://www.mbsplugins.eu/WebViewHasParent.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-22/New_in_MBS_FileMaker_Plugin_12/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr1](https://www.mbsplugins.de/archive/2022-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 28th January 2022 , last changed 28th January 2022

  
[WebView.HasOnlySecureContent](WebViewHasOnlySecureContent.md) - [WebView.InstallCallback](WebViewInstallCallback.md)

[HTML Version](WebViewHasParent.shtml)