Hi guys,
We are using svyJFXWebview module in our application and it works quiet well as we can use any jquery library and load it on our forms in smartclient. We use the jfxWebview to load our custom HTML contents in some of out modules when we need any fancy JqueryUI animations etc. We use JqueryUI accordion to show our setup options page for example. Now, the problem we have is that if I have a combobox in my html content and I select the combobox and have the list open, I am able to close the form without getting a focuslost event triggered on the combobox, so what happens is that the list stays open for as long as I click on one of the options on it, and that’s when it crashes internally as it tries to call something on the form that is closed and doesn’t exist anymore. The main issue here is that it seems the jfxvebview panel is somehow still open in the background(I think it is running on a different thread than the smartclient is running) and this prevent it from working anymore for as long as we have the application running. I can not open any other forms with jfx webview panel (it loads the page and renders nothing on the jfxwebview panel), and the only way to fix the issue is to close the whole app and re open it to get it to work again (probably closing the thread that the jfx instance is running on).
Can any one with some experience in using svyJFXWebView and probably facing the same problem, tell me how to prevent this from happening?
Cheers,
Siavash
TSM (The Service Manager)
I think that the only solution is to take care of your svyJFXWebview status in the onHide event of the form that contains it.
Thanks for your reply Nicola. But the question is, how can I actually control this behaviour?
1- is there anyway that I can call the onFocusLost of the HTML body when clicking on the X button to close the form? or any other part of the form that is outside of the webview? (as it seems that the webview is of its own component and is unaware of the servoy events)
2- is there anyway that I can close the webengine when closing my form and let it recreate it when opening the form again?
The thing is, even after this behaviour (crashing internally) if I open the form to show the webview panel on it again, everything goes normal and it goes through the same procedure as if everything is working fine, it just doesn’t load the content in the webview panel anymore!
Cheers,
Siavash
TSM (The Service Manager)
When the form that contains your webview is hidden the onHide event of that form is fired, in that method you need to take care of shutting down the webview gracefully, probably you will need to use the WebclientUtils plugin for that Overview - Web Client Utils - ServoyForge, you can use it as a bridge to communicate with the javascript code running inside the webview.
So, to summarize your scenario:
1: you have a form with a svyJFXWebView on it, which is displaying HTML that contains a combobox (HTML Select element).
2: When the user clicks on that combobox, the dropdown shows.
3: Then, without focusing anywhere else in the WebView panel (which would make the dropdown disappear), the user navigates to a different Servoy form, which hides the form with the svyJFXWebView on it.
4: And after that, no svyJFXWebView instance functions normally anymore?
If that is the case, I think there is not much you can do on your end. It would be something that has to be looked at in the codebase of the svyJFXWebView component, to see if it can be resolved and it might even be a bug in the underlying JavaFX WebView component.
Best starting point would be filing a bug, preferably with a sample solution demonstrating the issue
Nicola’s suggestion about the WebClientUtils plugin is not correct, that has absolutely no relation to the svyJFXWebView component.
Paul
Paul is right: focusing on a similar issue I had with web client and html areas, I forgot that you are using Smart Client, forget about the webclientUtils plugin suggestion. Sorry.
pbakker:
So, to summarize your scenario:
1: you have a form with a svyJFXWebView on it, which is displaying HTML that contains a combobox (HTML Select element).
2: When the user clicks on that combobox, the dropdown shows.
3: Then, without focusing anywhere else in the WebView panel (which would make the dropdown disappear), the user navigates to a different Servoy form, which hides the form with the svyJFXWebView on it.
4: And after that, no svyJFXWebView instance functions normally anymore?
If that is the case, I think there is not much you can do on your end. It would be something that has to be looked at in the codebase of the svyJFXWebView component, to see if it can be resolved and it might even be a bug in the underlying JavaFX WebView component.
Best starting point would be filing a bug, preferably with a sample solution demonstrating the issue
Nicola’s suggestion about the WebClientUtils plugin is not correct, that has absolutely no relation to the svyJFXWebView component.
Paul
Hi Paul,
Yes, the scenario is as you explained. I actually close the form by pressing x on the corner and the combo list still is there. Even if you then close the whole application, the list is still hanging on the air till you actually click on it!
What I have done so far as a temporary workaround (not a fix) is to use jqueryui comboboxes which are actually showing within the html area instead of hovering over the whole form, and they get disappear if you close the form even if their list is open.
I will file a bug and attach a sample solution to see if someone can find the actual issue or solve it somehow.
Cheers,
Siavash
TSM (The Service Manager)