-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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?.
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
Asked: 2014-07-30 16:07:10 +0800
Seen: 52 times
Last updated: Aug 01 '14
ArrayIndexOuOfBoundsException showing Messagebox
error PWC2788: setAttribute: Non-serializable attribute with name javax.zkoss.zk.ui.Session
no grammar constraints (dtd or xml schema) detected for the document
ListModelList.clear() - Error in ZK Framework?
Getting wierd NullPointerException when using Shiro
Script error when doing stuff in background thread
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 )editI 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 )editan 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