In my GWTQuery project, I have a situation where there are 4 custom drop-down menus. Whenever a user changes any of the current menu choice, an AJAX request is made with the values of the 4 menus (one of which is the newly changed value of that menu). Since all the 4 menus trigger similar request, I though that I will write a common class to handle the AJAX request, then let the clickhandlers extend that class.
But then, the menus being dynamically generated, I have to resort to GWTQuery's live
method. And that takes a variable of type Function
as parameter. Since it already extends Function, I can't make it extend my Ajax handler class as well. So how do I do it? Something like this is what I am looking for:
class f extends Funnction, AJAX_Handler {
public boolean f(Event e) {
...
return true;
}
public void request(int i1,int i2,int i3,int i4) {
//for handling the request, defined in the AJAX_Handler class
...
}
}
One thing, defining a generic handler for all 4 menus which contains the AJAX_handler functions, then detecting which menu is the current handler referring to is a no-no. The AJAX_handler class has to be a separate one.