0

upgrading to zk-5.0.1-FL-2010-02-08 throws an error

asked 2010-02-09 20:53:16 +0800

kesavkolla gravatar image kesavkolla
180 3

I just upgraded to zk 5.0.1-FL-2010-02-08 and got the following error in JavaScript:

Uncaught TypeError: Cannot set property 'height' of undefined

The page renders correctly and then the spinner Processing will never go away. The page is kind of inaccessible at this point.

Here is the zul file

<!-- $Id: index.zul 136 2010-01-31 06:52:07Z kesavkolla $ -->
<?page title="Body Feng Shui" contentType="text/html;charset=UTF-8" id="index"?>
<?link  rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<zk>
	<borderlayout id="main" style="background:#1e1406;" use="com.bodyfs.ui.MainLayoutCtrl">
		<center autoscroll="true" flex="true">
			<hbox pack="center">
				<vbox pack="center" height="400px">
					<div height="20px"></div>
					<groupbox id="gbox" mold="3d" open="true" closable="false">
						<caption label="Welcome Adminstrator" />
						<hbox pack="center" hflex="1">
							<div align="center" width="800px">
								<vbox>
									<hbox>
										<vbox>
											<div width="100%" align="center">
												Next Appointment Today: 10:00 AM (Neel Kamal)
											</div>
											<div>Time Remaining : 15 mins</div>
										</vbox>
										<space bar="true" height="100%"></space>
										<vbox>
											<div>10:00 AM (Patient 1)</div>
											<div>11:30 AM (Patient 2)</div>
											<div>2:00 PM (Patient 3)</div>
											<div>3:00 PM (Patient 4)</div>
										</vbox>

									</hbox>
									<div align="center" height="30px">
										<space bar="true" width="700px" orient="horizontal" />
									</div>
									<div width="100%" align="center">
										Next Re Examination Date:
										<label id="nextReExam" />
									</div>
									<div align="center" height="30px">
										<space bar="true" width="700px" orient="horizontal" />
									</div>
									<div width="100%" align="center" style="">
										There are
										<a id="newemails" href="#" label="3 new messages" />
										from Body Feng Shui
									</div>

								</vbox>
							</div>
						</hbox>
					</groupbox>

				</vbox>
			</hbox>
		</center>
	</borderlayout>
</zk>

This code works properly on zk 5.0-RC2. I am trying to upgrade from RC2 to 5.0.1-FL.

Any ideas why I am getting Javascript error?

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2010-02-09 21:35:45 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi, kesavkolla
Could you post "com.bodyfs.ui.MainLayoutCtrl"

I test your sample without MainLayoutCtrl
it works well

link publish delete flag offensive edit

answered 2010-02-09 23:53:43 +0800

kesavkolla gravatar image kesavkolla
180 3

Here is MainLayoutCtrl.java

public class MainLayoutCtrl extends Borderlayout implements AfterCompose, Serializable {

        private static final long serialVersionUID = -6108326798661059775L;
        private static final Map<String, String> metaAttrs = new HashMap<String, String>();
        static {
                metaAttrs.put("name", "keywords");
                metaAttrs.put("content", "Body Feng Shui, Chinese Medicine, Belmont");
        }
        protected transient AnnotateDataBinder binder;
        protected transient Borderlayout main;

        @Override
        public void afterCompose() {
                processRecursive(this, this);
                final Component comp = Executions.createComponents("/pages/common/header.zul", this, null);
                final Label username = (Label) comp.getFellow("username");
                if (username != null) {
                        final LoginInfo userInfo = (LoginInfo) this.getAttribute("LOGIN_CREDENTIALS", Page.SESSION_SCOPE);
                        if (userInfo != null) {
                                username.setValue(userInfo.getUserid());
                        }
                }
                // final HeaderInfo metaInfo = new HeaderInfo("meta", metaAttrs);
                // ExecutionsCtrl.getCurrentCtrl().getCurrentPageDefinition().addHeaderInfo(metaInfo);
                Executions.createComponents("/pages/common/footer.zul", this, null);

                Components.wireVariables(this, this); // auto wire variables
                Components.addForwards(this, this); // auto forward
                binder = new AnnotateDataBinder(this);
                binder.loadAll();
        }
}

And the header.zul is like this

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<?meta name="keywords" content="Body Feng Shui, Chinese Medicine, Belmont" ?>
<zk>
	<north size="100px" border="0">
		<borderlayout hflex="1" vflex="1" style="background-image: url(/img/top_bg.jpg);background-repeat: repeat-x;">
			<west border="0">
				<image src="/img/logo_small_size.jpg" hflex="1" width="404px" height="100px" id="logo" />
			</west>
			<east border="0" style="background-image: url(/img/top_bg.jpg);background-repeat: repeat-x;">
				<hbox hflex="1" vflex="1" style="padding-top:20px">
					<a href="/logout.zul" sclass="lg-label">Logout</a>
					<space />
					<label id="username" sclass="lg-label" style="font-weight: bold" />
					<space width="30px" />
				</hbox>
			</east>
		</borderlayout>
	</north>
	<west title="Action Menu" size="170px" flex="true" splittable="true" minsize="150" maxsize="500"
		collapsible="true">
		<div>
			<vbox width="100%">
				<toolbarbutton label="Customers" image="/img/user_group_colored.png" hflex="1"
					href="/pages/usermgmt/customersearch.zul" />
				<toolbarbutton label="Scheduling" image="/img/ical.png" hflex="1" href="/pages/schedule/calendar.zul" />
				<!-- toolbarbutton label="Settings" image="/img/preferences.png" hflex="1" href="#" /-->
				<!-- toolbarbutton label="Inventory" image="/img/database.png" hflex="1" href="#" / -->
				<!-- toolbarbutton label="Payments" image="/img/money_100dollar_Coins.png" hflex="1" href="#" / -->
				<!-- toolbarbutton label="Herbs" image="/img/leaf.png" hflex="1" href="#" /-->
			</vbox>
			<script type="text/javascript" defer="true">
				zk.afterMount(function() { $("$logo").click(function() { window.location.href="/index.zul";});});
			</script>
		</div>
	</west>
</zk>

link publish delete flag offensive edit

answered 2010-02-10 02:56:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-02-10 02:56:32 +0800

Hi,

1. take a try with comment out this line :
// processRecursive(this, this);
I remember this was only for searching inner window containers and getting the components on it.

2. Have you try to put a window component around the borderlayout for a correct use of use="com.bodyfs.ui.MainLayoutCtr"

best
Stephan

link publish delete flag offensive edit

answered 2010-02-10 10:16:46 +0800

kesavkolla gravatar image kesavkolla
180 3

<east border="0" style="background-image: url(/img/top_bg.jpg);background-repeat: repeat-x;">
				<hbox hflex="1" vflex="1" style="padding-top:20px">
					<a href="/logout.zul" sclass="lg-label">Logout</a>
					<space />
					<label id="username" sclass="lg-label" style="font-weight: bold" />
					<space width="30px" />
				</hbox>
			</east>

This piece was giving problem. When I put vflex="1" for hbox inside the east it is throwing that javascript error. I removed the vflex and hflex to hbox and things working normally.

link publish delete flag offensive edit

answered 2010-02-10 11:02:03 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

I read that hflex/vflex works only in components. Are hbox / vbox not containers?

link publish delete flag offensive edit

answered 2010-02-12 11:29:57 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

@kesavkolla,

Looks like a bug. Please post to ZK Bugs and we will track from there.

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-02-09 20:53:16 +0800

Seen: 852 times

Last updated: Feb 12 '10

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