0

Error "Only one child is allowed"

asked 2014-07-30 16:07:10 +0800

wigberto gravatar image wigberto
52 4

updated 2014-07-30 16:10:13 +0800

I have code:

<zk>
<!-- create only when the currentUser is not an anonymous -->
<borderlayout hflex="1" vflex="1" if="${not sessionScope.userCredential.anonymous}">
<center id="mainContent" autoscroll="true" border="none"
self="@insert(content)">
</center>
<south height="50px" border="none">
<include src="/layout/footer.zul" />
</south>
</borderlayout>
<div if="${sessionScope.userCredential.anonymous}">
Redirect to login page.....
</div>
</zk>

I have updated to the version 7.0.2 and the error takes place: "Only one child and one caption is allowed: Center y6FP0#mainContent". Do I believe that it is for the label "center", it is possible?.

delete flag offensive retag edit

Comments

question is what do you insert here ? self="@insert(content)" only one child can be added below a center. So please check where you are using this template and what you insert.

cor3000 ( 2014-07-31 02:08:12 +0800 )edit

I have index.zul with code: <include self="@define(content)" src="/console/console.zul" /> and i have template.zul with code: <center id="mainContent" autoscroll="true" border="none" self="@insert(content)"/> it does not work in the version 7.0.2

wigberto ( 2014-07-31 09:34:44 +0800 )edit

an yes the error message usually appears when trying to add more than one child to a layout region such as the <center> component.

cor3000 ( 2014-08-01 08:42:38 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-01 08:39:24 +0800

cor3000 gravatar image cor3000
4571 2 7
ZK Team

updated 2014-08-01 08:48:10 +0800

Hi,

from what you describe I created this example on zkfiddle and it works. Can you please fill in what I am missing to reproduce the issue?

the error message can be forced when doing something obviously wrong - e.g. defining the content twice:

<?init class="org.zkoss.zk.ui.util.Composition" arg0="template.zul"?>
<zk>
  <include self="@define(content)" src="console.zul"/>
  <include self="@define(content)" src="console.zul"/>
</zk>

Robert

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-07-30 16:07:10 +0800

Seen: 41 times

Last updated: Aug 01 '14

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