MonkeybreadSoftware Posted Tuesday at 07:56 AM Posted Tuesday at 07:56 AM Sometimes plugin users wonder why the plugin doesn't see the WebViewer on the layout, so let's check the various cases: 1. Empty WebViewer Just put an empty web viewer on a layout. No URL. Does it exist? When you go to the browse mode, you see the outline drawn, but if you ask the plugin about the web viewer, it can't find it. Until FileMaker loads something into the WebViewer, it doesn't exist as a control with the operation system and the plugin can't see it. 2. Blank WebViewer You can put in the URL "about:blank" and then FileMaker creates the WebViewer right away. If you do something in the script trigger for layout entering, you may need a short pause of 0.1 seconds for FileMaker to create the WebViewer. Same when you just switched layouts. FileMaker delays building the layout on screen to avoid flickering. 3. Out of sight If the web viewer is not in the visible area, FileMaker doesn't create it. This can mean that resizing the window may bring the WebViewer in sight and thus FileMaker creates the control and we can see from the plugin. 4. On tabs If you have a tab control with various tabs, the WebViewer can be on a tab. But FileMaker only creates it, if you go on the right tab. If you move to a different tab, the WebViewer is removed from the window, but not freed. So if you come back later, FileMaker can put the same WebViewer on the tab and it keeps the content. Same for slide control and multiple pages there. 5. Hide object when You can use the calculation to hide the layout object with your WebViewer. But if this hides the WebViewer, there is none in the window. Once the calculation changes to return zero, the WebViewer is created. And that may need a short pause if it happens by script, before it happens. 6. Behind something You can have another layout object in front of the WebViewer, e.g. a rectangle. This way you can run JavaScript or interact with a website, but not show it to the user. Just put a white rectangle in front of the WebViewer. 7. Plugin based WebViewer If you use WebView.Create in MBS FileMaker Plugin to create a WebViewer, then FileMaker doesn't know about it. Our plugin can use the WebViewer to show content, but FileMaker has no clue. The WebViewer can lay on top of your layouts. If FileMaker moved from record to record, the WebViewer from our plugin stays there and doesn't reload. But if FileMaker rebuilds the layout for the window, there is a chance, that FileMaker removed all existing controls including ours and then you may need to rebuild the plugin based WebViewer. Check out our WebViewer functions to work with WebViewer controls in FileMaker. Let us know if you have questions!
Recommended Posts