0

Listitem in borderlayout - org.zkoss.zk.ui.UiException: Wrong parent

asked 2009-07-13 12:07:16 +0800

kingsz1 gravatar image kingsz1
81 1 3

updated 2009-07-13 12:08:24 +0800

Hello all. I have a page like this:

<?xml version="1.0" encoding="UTF-8" ?>
<?page id="indexZUL" title="Sample ZK with JPA + Derby" cacheable="false"
	language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>

<zk>
<borderlayout id="win" use="com.jpa.UuserTest1">

        <panel width="50%" border="normal" title="Data List">
        <panelchildren>
       	<div align="left">
            <listbox id="lb" width="500" height="300" >
            <listhead sizable="true">
                    <listheader label="Email " sort="auto" width="150px"/>
                    <listheader label="LoginID " width="120px" />
                    <listheader label="Password"  width="120px" />
                    <listheader label="Alias " sort="auto"  width="100px"/>
            </listhead>

            <listitem forEach="${win.uuser}" value="${each}">
                    <listcell label="${each.uemail}"/>
                    <listcell label="${each.bulaid}"/>
                    <listcell label="${each.bulaword}"/>
                    <listcell label="${each.ualias}"/>
            </listitem>
            </listbox>
		</div>
        </panelchildren>
        </panel>

</borderlayout>
</zk>

the page display the records from datasource, working fine.
But when I placed listitem into a 2 columns layout,such as inside <center></center>, like this
    <center flex="true">

        <panel width="50%" border="normal" title="Data List">
        <panelchildren>
       	<div align="left">
            <listbox id="lb" width="500" height="300" >
            <listhead sizable="true">
                    <listheader label="Email " sort="auto" width="150px"/>
                    <listheader label="LoginID " width="120px" />
                    <listheader label="Password"  width="120px" />
                    <listheader label="Alias " sort="auto"  width="100px"/>
            </listhead>

            <listitem forEach="${win.uuser}" value="${each}">
                    <listcell label="${each.uemail}"/>
                    <listcell label="${each.bulaid}"/>
                    <listcell label="${each.bulaword}"/>
                    <listcell label="${each.ualias}"/>
            </listitem>
            </listbox>
		</div>
        </panelchildren>
        </panel>

    </center> 


When run, it display a error: org.zkoss.zk.ui.UiException: Wrong parent: <UuserTest1 win>
What is the problem? how can I set listitem to display in a layoutof a page?
Thanks for any help.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-07-14 08:00:44 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

you provide an non-runnable code in both case.

link publish delete flag offensive edit

answered 2018-11-21 17:22:54 +0800

hechteka gravatar image hechteka
51 1

A Center, north, south, west and east can never be alone it always has to be surrounded by <borderlayout>

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: 2009-07-13 12:07:16 +0800

Seen: 652 times

Last updated: Nov 21 '18

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