* It is OK to send event to component from another page as long as
* they are in the same desktop.
*/
public static void sendEvent(Component comp, Event event) {
final Execution exec = Executions.getCurrent();
final Desktop desktop = exec.getDesktop();
//note: we don't use comp.getDesktop because 1) it may be null
//2) it may be different from the current desktop
event = ((DesktopCtrl)desktop).beforeSendEvent(event);
if (event == null)
return; //done
final Thread thd = (Thread)Thread.currentThread();
if (!(thd instanceof EventProcessingThread)) {
if (!desktop.getWebApp().getConfiguration().isEventThreadEnabled()) {
final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
final Page page = execCtrl.getCurrentPage();
final EventProcessor proc =
new EventProcessor(desktop, comp, event);
proc.setup();