GWT: ErrorHandler what type of errors it will catch on widgets - gwt2

Hi Just going through GWT 2.5, came across ErrorHandler, which can be added to a widget which has implemented hasErrorHanlder. Can anyone help me in understanding.
I am trying to write new Custom widget by extending the Compoiste if i implement HasErrorHanlders interface it helps me to catch what ever errors occur in this class should be known to it usage class... may be i am wrong..?

It is a DOM event and not GWT widget event. It is fired or used only in some GWT internal cases for DOM related errors. I have seen only GWT Image class use this class.
It is of no use in Composite widgets as far i have come across. It would be interesting if we can find any other use case. Note: It is raised or triggered as DomEvent and is not triggered otherwise in GWT code.
Edit - Use Uncaught Exception Handler in GWT to handle such odd cases.
1) http://stackoverflow.com/questions/3028521/gwt-setuncaughtexceptionhandler
2) http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/core/client/GWT.html#setUncaughtExceptionHandler(com.google.gwt.core.client.GWT.UncaughtExceptionHandler)

Related

geb jquery.mouseover() not working

The geb documentation shows that it has built in jQuery support. Im interested in one particular method called mouseover. However when I try to use the mouseover function I get a warning saying, "Cannot resolve symbol 'mouseover'". This happens even when I'm using the code in their example. What am I missing?
This might not directly answer your question. But if you are trying to mimic mouse over action in Geb, you could also use
interact {
moveToElement(element)
}
http://www.gebish.org/manual/current/#interact-closures

What is the AlertOverride class used for in WebDriver?

In Selenium 2.0 there is a class I've seen used with WebDriverCommandProcessor called AlertOveride. Unfortunately I cannot seem to find any documentation around this class, does anyone have any knowledge of what the class is meant to be used for?
Looking at the JavaScript in the file it seems that this class is responsible for overriding the alert and confirm boxes that we would typically see when invoked in the application under test. The way selenium works it was unable to interact with those modal boxes, hence the need to override their defaults. I don't see a way to override that functionality (although it might be doable with a DesiredCapability).
I'm guessing that one of the first things the WebDriver instance does upon loading a page is invoking the methods in the AlertOverride class, so that we can get a handle on alerts/confirmations as soon as possible. This would also make sense as to why we can't get a handle on confirmation boxes that are created on the onload functions.

Rendering a GSP in grails as PDF via a Quartz Job problems

Has anyone had success in Grails 1.3.7 rendering gsps inside a quartz job?
I'm having a tough time getting it to work, tried various options including the template engine plugin, and the renderer plugin.
The Grailstemplateengine plugin doesn't get far at all, when the call is made to render, I get:
No signature of method: GrailsTemplateEngineService.renderWithTemplateEngine() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap) values: [/reports/templates/product_summary, [model:net.dbws.ieur.ProductSummaryModel#356eb0]]
Renderer plugin looks to be getting the furtherest except it seems to not control its own output correctly, calling pdfRenderingService() appears to be outputting the rendered PDF to standard out, as I'm seeing the content output in the IDE's output window, rather than rednering to its own byte array. And its raising an exception as its doing some kind of illegal cast as mixed in the output I can see 'java.io.ByteArrayOutputStream' to class 'java.lang.Number' [See nested exception: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '%PDF-1.4'
So if anyone had success rendered gsps from within a quartz job, i'd love to know how you did it.
Thanks,
Ok found issue.... The docs for the grails template engine were totally out of date and incorrect.. it should have been calling 'renderView' not renderWithTemplateEngine

Adobe Air HtmlLoader - quietly failing

Hi I am trying to load page into Air using the htmlLoader class. What event listener will I need to attach to the HTMLLoader class in order for it to notify me when the page can not be loaded.
Any help much appreciated
The only event fired directly from the HTMLLoader that appears to be error handling is:
uncaughtScriptException
Signals that an uncaught JavaScript exception occurred in the HTMLLoader object.
however when you call send and pass along a URLRequest you should be able to add listeners to the Loader, from an example in the docs, this should be good enough:
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
in your case I'm guessing you'll need to use the HTMLLoader instance's loaderInfo property and add the listeners there.
Hope this helps.

Methods best practice - VB.NET

I have a program that is getting pretty big and it is a pain to find everything through all the functions and classes.
I am trying to break it up into other files based on their method.
Some of these functions have calls to others in the main class. I changed most my functions from private to public to access this. I had problems calling certain code created windows so importing mainwindow helped that.
My last problem is editing the mainwindow ui from one of the module files. I want to make sure im on the right page before i continue breaking it up. My only guess is that anything they updates the ui should be left on the main class.
Thanks
The only code in your form class should be code that talks to other classes and updates the UI based on data from other classes.
Depending on your application, the form class might handle change events from other classes to update the UI or pass user input to other classes in Change or Click events.
A couple options:
Use callbacks into the your main window.
Create events for when you need the form updated. Your program logic raises the events, and your main window class can consume them.