0

afterCompose() called twice

asked 2010-09-22 05:51:35 +0800

adamzk gravatar image adamzk
207 1

Hi
Is that an error or a feature in ZK? When I use: Executions.getCurrent().sendRedirect( "/zul/page.zul" ) constructor of the window associated with page.zul and afterCompose method are called twice! But when I enter the page in "normal way" everything is fine. Is there any param that can affect this behaviour?

Regards

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2010-09-22 06:59:54 +0800

SparkySpider gravatar image SparkySpider
444 1 3

updated 2010-09-22 07:00:07 +0800

What do you mean? The doAfterCompose() method being called twice on the referring page, or the destination page, or one each? What problem are you experiencing?

link publish delete flag offensive edit

answered 2010-09-22 07:04:47 +0800

adamzk gravatar image adamzk
207 1

After using sendRedirect to the same page on which I am now constructor and afterCompose are called twice - these are two different instances. Can I affect this behaviour? It should be called only once.

link publish delete flag offensive edit

answered 2010-09-22 07:17:25 +0800

adamzk gravatar image adamzk
207 1

There are two brand new different Window objects created after sendRedirect. There is no old window - I invalidate it.

link publish delete flag offensive edit

answered 2010-09-22 11:00:23 +0800

adamzk gravatar image adamzk
207 1

THe problem is that ZK is creating two desktops.

link publish delete flag offensive edit

answered 2010-09-22 20:29:21 +0800

SimonPai gravatar image SimonPai
1696 1

Hi adamzk,

afterCompose() is only available in Include and Macro, but from your description it's hard to figure out where they are involved. Can you provide a simple sample that reproduce the case?
Also, what is your ZK version?

Regards,
Simon

link publish delete flag offensive edit

answered 2010-09-23 04:49:05 +0800

adamzk gravatar image adamzk
207 1

zk. 5.0.4
Problem is:
1. Click on the button on page /zul/myPage.zul
2. In event handler method for this button is code:
getPage().invalidate();
getDesktop().invalidate();
Executions.deactivate( getDesktop() );
invalidate();
Executions.getCurrent().sendRedirect( "/zul/myPage.zul" );
3. After send redirect I can see in logs: 2010-09-23 11:46:38 org.zkoss.zk.ui.http.WebManager getDesktop:399
FINE: Create desktop for /zul/myPage.zul
2010-09-23 11:46:38 org.zkoss.zk.ui.http.WebManager getDesktop:399
FINE: Create desktop for /zul/myPage.zul

So ZK is creating two desktops after redirect!!!!!!
What the hell!! ??

Regards

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: 2010-09-22 05:51:35 +0800

Seen: 400 times

Last updated: Sep 23 '10

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