0

Server push thread cannot access components

asked 2008-06-16 22:05:59 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5036739

By: brendan4linux

Hi,
I am trying to follow the server push guide at:
http://zkoss.org/smalltalks/zk3.0rc/zk3.0rc.dsp

In a zscript file (included from a zul page), I am calling a new Thread (class from the guide):

desktop.enableServerPush(true);
MyThread thread = new MyThread(hbox);
mythread.start();

In my Thread class, I get the following error, however

Exception in thread "Thread-35" java.lang.IllegalStateException: Components can be accessed only in event listener

This also happens when trying to run the demo on that same web page. Am I doing something out of order/wrong? I run Executions.activate(_desktop) from within the 'MyThread' class.

Thanks,
Brendan

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2008-06-17 04:06:58 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5037129

By: jebberwocky

Refer to this thread https://sourceforge.net/forum/message.php?msg_id=4573498

link publish delete flag offensive edit

answered 2008-06-17 06:06:10 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5037239

By: brendan4linux

Sorry, i'm new to ZK - I'm not sure what you mean? Is there a possible issue with the code I posted above? I enabled server push on the desktop before calling
start() on the new thread, as I have seen in many examples, but it still throws that error, whether with the demo code or my code.

Thanks,
B

link publish delete flag offensive edit

answered 2008-06-18 00:48:01 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5039074

By: robbiecheng

Hi Brendan,

Please make sure you don't do any modification to ZK components after invoking Executions.deactivate(_desktop); //you cannot access ZK components from now on

And take a look at this example,
http://zkoss.org/doc/devguide/ch05s04s02.html

/robbie

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-06-16 22:05:59 +0800

Seen: 195 times

Last updated: Jun 18 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More