Hi,
what i want to do is the following:
I have a custom subclass of WEditor which consists of a textfield and a button. If the button is pressed, i initiate a call via our asterisk telephone system. I don't want to block the ui so i initiate the call via a worker class (subclass of java.lang.Thread) which calls my editor once it has initiated the call. Now i want to change the button image so the user can see that the call is initiated. If he click the button again, i want to end the call. I already did this in the swing client and it works great but in the webui several errors occured to me.
The first error is that if i try to change the button image from the method which gets called by my worker, i get a java.lang.IllegalStateException: Components can be accessed only in event listeners. This is what actually worked in the swing client...
So i tried to post an event but every event i post programmatically causes a NullPointerException because Events.postEvent() makes use of Execution exec = Executions.getCurrent(); when posting events and this is null because my worker is running in another thread.
The next thing i tried is to save the current executions to an instance variable and post my event there but my event never shows up in the editors onEvent() method.
Even if i try to post an event before is start my worker, the event does not show up in my event listener.
I would really like to learn what i am doing wrong and how to solve my problem. Every hint into the right direction is appreciated!