getting html property of ServoyBrowser bean
When in the debugger it is not possible to call the html property of the ServoyBrowser bean from the Interactive Console.
This is the exception thrown:
"Error during evaluation:Wrapped java.lang.IllegalStateException: This call must happen in the AWT Event Dispatch Thread! Please refer to http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html and http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)"
Updated by Patrick Talbot almost 11 years ago
- Status changed from New to Rejected
Nothing I can do about it: as the Exception says, the call must happen in the AWT thread (which is the case when you call it regularly but not true if you call it from the debugger), but I cannot wrap the call using SwingUtilities.invokeLater(Runnable) because this call doesn't return immediately, this is the type of call that needs a callback and synchronizing.
And SwingUtilities.invokeAndWait is not secure (it might deadlock).
So I guess that if you need to find out what's in that call (which is not really a property but a call to the js_getHtml() method), you are best to set a variable to the content then debug that variable after it has been set.
var html = elements.servoy_browser.html;
application.output(html); // <-- you can set a breakpoint here, and debug the variable html