0

Page already covered by data binder exception when dynamically opening ZUL pages

asked 2010-05-04 02:53:13 +0800

raevel2 gravatar image raevel2
72 1 2

I have a main ZUL page with a window, in this window I want to open other ZUL pages dynamically.

I do this by fetching the main page's Window and running

Executions.createComponents(zulPageUri, mainWin, null);

The problem I'm having is that the ZUL pages I include have data binder's associated with them (using <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> in their ZUL pages). If I open more than one new page I get the error "org.zkoss.zk.ui.UiException: Page is already covered by another Data Binder. Cannot be covered by this Data Binder again. Page:mainPage", where mainPage is the id of the main page that includes the other ZUL's. The main page does not have the AnnotateDataBinderInit.

I tried moving the data binding init to the main page (like I do when i use <include>), but then data bindings were not enabled on the inner pages.

How should I go about fixing this problem, and letting all my inner pages use data bindings?

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-05-04 08:46:26 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

updated 2010-05-04 08:47:21 +0800

You have to inform the binder the target (root) component for that binder in each zul page. If you omit this, it'll append the binder in the page, thus the error you're getting. Will be something like (not tested pseudo code read javadoc):

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="wnd"?>

<window id="wnd" >components here...</window>

Javadocs here

Regards,
Madruga

link publish delete flag offensive edit

answered 2010-05-04 09:42:56 +0800

raevel2 gravatar image raevel2
72 1 2

Thanks! I managed to get this working properly now.

For the record I ended up adding a counter to my controller, and for every new window i open i set args.put("windowId", counter++); and then in my ZUL pages:

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./${arg.windowId}" ?>

<window id="${arg.windowId}">

link publish delete flag offensive edit

answered 2010-09-15 06:44:49 +0800

m17 gravatar image m17
39

just a question - why do you need to include this sequential number in the window name ?.
Since ZK 3.5.0 the databinder is stored in the specified component scope. So you could simple specify current window and it works fine.

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./win" ?>

<window id="win">

link publish delete flag offensive edit

answered 2010-12-30 01:02:23 +0800

yaryan997 gravatar image yaryan997
210 2

@raevel2

Hi.. friend
I did as you said to solve my error "org.zkoss.zk.ui.UiException: Page is already covered by another Data Binder. Cannot be covered by this Data Binder again. Page:mainPage" but it throws me another error "org.zkoss.zk.ui.UiException: ID cannot be empty"

just help me to get out of this..
thanx in advance

link publish delete flag offensive edit

answered 2011-03-02 18:53:03 +0800

SimonD gravatar image SimonD
3

Hi,

After been bitten by this myself I think the nicest solution I've seen was posted by jjrafael at http://www.zkoss.org/forum/listComment/13994

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-05-04 02:53:13 +0800

Seen: 2,595 times

Last updated: Mar 02 '11

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